3
3
namespace Jhoff \BladeVue ;
4
4
5
5
use Jhoff \BladeVue \Directives \Basic ;
6
- use Illuminate \Support \Facades \Blade ;
7
6
use Jhoff \BladeVue \Directives \Inline ;
8
7
use Illuminate \Support \ServiceProvider ;
8
+ use Illuminate \View \Compilers \BladeCompiler ;
9
9
10
10
class DirectiveServiceProvider extends ServiceProvider
11
11
{
@@ -23,20 +23,22 @@ class DirectiveServiceProvider extends ServiceProvider
23
23
*/
24
24
public function register ()
25
25
{
26
- Blade::directive ('vue ' , function ($ expression ) {
27
- return Basic::start ($ expression );
28
- });
26
+ $ this ->app ->afterResolving ('blade.compiler ' , function (BladeCompiler $ bladeCompiler ) {
27
+ $ bladeCompiler ->directive ('vue ' , function ($ expression ) {
28
+ return Basic::start ($ expression );
29
+ });
29
30
30
- Blade:: directive ('endvue ' , function () {
31
- return Basic::end ();
32
- });
31
+ $ bladeCompiler -> directive ('endvue ' , function () {
32
+ return Basic::end ();
33
+ });
33
34
34
- Blade:: directive ('inlinevue ' , function ($ expression ) {
35
- return Inline::start ($ expression );
36
- });
35
+ $ bladeCompiler -> directive ('inlinevue ' , function ($ expression ) {
36
+ return Inline::start ($ expression );
37
+ });
37
38
38
- Blade::directive ('endinlinevue ' , function () {
39
- return Inline::end ();
39
+ $ bladeCompiler ->directive ('endinlinevue ' , function () {
40
+ return Inline::end ();
41
+ });
40
42
});
41
43
}
42
44
}
0 commit comments