5
5
use Illuminate \Foundation \Testing \TestResponse as LegacyTestResponse ;
6
6
use Illuminate \Http \Request ;
7
7
use Illuminate \Routing \Router ;
8
- use Illuminate \Support \Facades \Blade ;
9
8
use Illuminate \Support \ServiceProvider as BaseServiceProvider ;
10
9
use Illuminate \Testing \TestResponse ;
11
10
use Illuminate \View \FileViewFinder ;
@@ -27,6 +26,7 @@ public function register(): void
27
26
'inertia '
28
27
);
29
28
29
+ $ this ->registerBladeDirectives ();
30
30
$ this ->registerRequestMacro ();
31
31
$ this ->registerRouterMacro ();
32
32
$ this ->registerTestingMacros ();
@@ -42,7 +42,6 @@ public function register(): void
42
42
43
43
public function boot (): void
44
44
{
45
- $ this ->registerBladeDirectives ();
46
45
$ this ->registerConsoleCommands ();
47
46
48
47
$ this ->publishes ([
@@ -52,8 +51,10 @@ public function boot(): void
52
51
53
52
protected function registerBladeDirectives (): void
54
53
{
55
- Blade::directive ('inertia ' , [Directive::class, 'compile ' ]);
56
- Blade::directive ('inertiaHead ' , [Directive::class, 'compileHead ' ]);
54
+ $ this ->callAfterResolving ('blade.compiler ' , function ($ blade ) {
55
+ $ blade ->directive ('inertia ' , [Directive::class, 'compile ' ]);
56
+ $ blade ->directive ('inertiaHead ' , [Directive::class, 'compileHead ' ]);
57
+ });
57
58
}
58
59
59
60
protected function registerConsoleCommands (): void
0 commit comments