File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,20 @@ public function boot()
7070 });
7171 }
7272
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.
7478 $ 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+ });
7787 }
7888
7989 /**
You can’t perform that action at this time.
0 commit comments