Skip to content

Commit 2898222

Browse files
committed
defer component registering after the blade compiler is resolved
1 parent d04677d commit 2898222

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/BackpackServiceProvider.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Illuminate\Support\Facades\Blade;
1414
use Illuminate\Support\ServiceProvider;
1515
use Illuminate\Support\Str;
16+
use Illuminate\View\Compilers\BladeCompiler;
1617

1718
class BackpackServiceProvider extends ServiceProvider
1819
{
@@ -302,7 +303,10 @@ public function loadConfigs()
302303

303304
public function loadViewComponents()
304305
{
305-
Blade::componentNamespace('Backpack\\CRUD\\app\\View\\Components', 'backpack');
306+
$this->app->afterResolving(BladeCompiler::class, function () {
307+
Blade::componentNamespace('Backpack\\CRUD\\app\\View\\Components', 'backpack');
308+
});
309+
306310
}
307311

308312
/**

0 commit comments

Comments
 (0)