Skip to content

Commit e6adfad

Browse files
committed
No need to include routes if they are already cached
1 parent 529aae4 commit e6adfad

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ServiceProvider.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ public function boot()
5858
'prefix' => 'arrilot',
5959
];
6060

61-
$this->app['router']->group($routeConfig, function ($router) {
62-
$router->get('load-widget', 'WidgetController@showWidget');
63-
});
61+
if (! $this->app->routesAreCached()) {
62+
$this->app['router']->group($routeConfig, function ($router) {
63+
$router->get('load-widget', 'WidgetController@showWidget');
64+
});
65+
}
6466

6567
$this->registerBladeDirective('widget', '$1<?php echo app("arrilot.widget")->run$2; ?>');
6668
$this->registerBladeDirective('async-widget', '$1<?php echo app("arrilot.async-widget")->run$2; ?>');

0 commit comments

Comments
 (0)