File tree 1 file changed +13
-3
lines changed 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,20 @@ public function boot()
70
70
});
71
71
}
72
72
73
- $ this ->registerBladeDirective ('widget ' , '$1<?php echo app("arrilot.widget")->run$2; ?> ' );
73
+ Blade::directive ('widget ' , function ($ expression ) {
74
+ return "<?php echo app('arrilot.widget')->run {$ expression }; ?> " ;
75
+ });
76
+
77
+ // Blade::directive cannot recognize @async-widget, so @async-widget still use the custom matcher.
74
78
$ this ->registerBladeDirective ('async-widget ' , '$1<?php echo app("arrilot.async-widget")->run$2; ?> ' );
75
- $ this ->registerBladeDirective ('asyncWidget ' , '$1<?php echo app("arrilot.async-widget")->run$2; ?> ' );
76
- $ this ->registerBladeDirective ('widgetGroup ' , '$1<?php echo app("arrilot.widget-group-collection")->group$2->display(); ?> ' );
79
+
80
+ Blade::directive ('asyncWidget ' , function ($ expression ) {
81
+ return "<?php echo app('arrilot.async-widget')->run {$ expression }; ?> " ;
82
+ });
83
+
84
+ Blade::directive ('widgetGroup ' , function ($ expression ) {
85
+ return "<?php echo app('arrilot.widget-group-collection')->group {$ expression }->display(); ?> " ;
86
+ });
77
87
}
78
88
79
89
/**
You can’t perform that action at this time.
0 commit comments