Skip to content

Commit

Permalink
Add custom DynamicComponent class to use our ComponentTagCompiler ins…
Browse files Browse the repository at this point in the history
…tead of Laravel's
  • Loading branch information
bakerkretzmar committed Jun 25, 2024
1 parent 213af78 commit 6850835
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Providers/ViewServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace TightenCo\Jigsaw\Providers;

use Illuminate\View\DynamicComponent;
use Illuminate\View\Engines\CompilerEngine;
use Illuminate\View\Engines\EngineResolver;
use Illuminate\View\Engines\FileEngine;
Expand All @@ -16,6 +15,7 @@
use TightenCo\Jigsaw\Support\ServiceProvider;
use TightenCo\Jigsaw\View\BladeCompiler;
use TightenCo\Jigsaw\View\BladeMarkdownEngine;
use TightenCo\Jigsaw\View\DynamicComponent;
use TightenCo\Jigsaw\View\MarkdownEngine;
use TightenCo\Jigsaw\View\ViewRenderer;

Expand Down
22 changes: 22 additions & 0 deletions src/View/DynamicComponent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace TightenCo\Jigsaw\View;

use Illuminate\Container\Container;
use Illuminate\View\DynamicComponent as BaseDynamnicComponent;

class DynamicComponent extends BaseDynamnicComponent
{
protected function compiler()
{
if (! static::$compiler) {
static::$compiler = new ComponentTagCompiler(
Container::getInstance()->make('blade.compiler')->getClassComponentAliases(),
Container::getInstance()->make('blade.compiler')->getClassComponentNamespaces(),
Container::getInstance()->make('blade.compiler')
);
}

return static::$compiler;
}
}

0 comments on commit 6850835

Please sign in to comment.