have you considered caching the routes ? php artisan route:cache https://laravel.com/docs/5.0/controllers#route-caching
You could break them up, putting related routes together in separate files and then dynamically include needed route files.
yes that would be your next solution. but if this happens only when you test i don't think it's much of a problem since you're running unit tests only once per test session.
I'm currently trying the approach with loading the routes dynamically like that (in routes.php):
if (Request::is('module/*') {
Route::group(...);
}
It works in the browser, however, when I try to test the routes, phpunit doesn't find them. In TestCase.php there is a createApplication() method, and in it:
$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
which loads the routes.php file without any request, so the specific routes don't load.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community