Skip to content

Commit c6a0ea8

Browse files
Improves routes loading for routes caching
1 parent ce9e7a8 commit c6a0ea8

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Providers/Service.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ class Service extends ServiceProvider
1010
{
1111
public function boot()
1212
{
13-
app('router')->group(app("router")->hasMiddlewareGroup('web')
14-
? ['middleware' => 'web']
15-
: [], function () {
16-
require __DIR__ . '/../../routes/web.php';
13+
$this->loadRoutesFrom(__DIR__.'/../../routes/web.php');
1714

18-
if (config("app.env") === 'internaltesting') {
19-
require __DIR__ . '/../../tests/routes/web.php';
20-
}
21-
});
15+
if (config("app.env") === 'internaltesting') {
16+
$this->loadRoutesFrom(__DIR__.'/../../tests/routes/web.php');
17+
}
2218

2319
$configPath = __DIR__ . '/../../config/genealabs-laravel-caffeine.php';
2420
$this->mergeConfigFrom($configPath, 'genealabs-laravel-caffeine');

0 commit comments

Comments
 (0)