Skip to content

Commit b6540f8

Browse files
committed
Blade::directive cannot recognize @async-widget, so @async-widget still use the custom matcher.
1 parent 2ec359f commit b6540f8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/ServiceProvider.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,15 @@ public function boot()
7474
return "<?php echo app('arrilot.widget')->run{$expression}; ?>";
7575
});
7676

77-
Blade::directive('async-widget', function ($expression) {
78-
return "<?php echo app('arrilot.async-widget')->run{$expression}; ?>";
79-
});
77+
// Blade::directive cannot recognize @async-widget, so @async-widget still use the custom matcher.
78+
$this->registerBladeDirective('async-widget', '$1<?php echo app("arrilot.async-widget")->run$2; ?>');
8079

8180
Blade::directive('asyncWidget', function ($expression) {
8281
return "<?php echo app('arrilot.async-widget')->run{$expression}; ?>";
8382
});
8483

85-
Blade::directive('asyncWidget', function ($expression) {
86-
return "<?php echo app('arrilot.arrilot.widget-group-collection')->group{$expression}->display(); ?>";
84+
Blade::directive('widgetGroup', function ($expression) {
85+
return "<?php echo app('arrilot.widget-group-collection')->group{$expression}->display(); ?>";
8786
});
8887
}
8988

0 commit comments

Comments
 (0)