Open utterances-bot opened 3 years ago
Is there a way you can restrict the routes from running on prod or having a security key popup on them? I see them as a security risk if left unchecked.
@PhillipMwaniki I think that the environment check in the RouteServiceProvider
before the dev routes are mapped takes care of your concern.
How if we can check it also if file exist load the dev.php
route if not dont load it so it will not commited on version control 🙄
Adding the following to the boot() method in RouteServiceProvider (Laravel 8.41.0) worked for me:
if (app()->environment('local')) {
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/dev.php'));
}
Adding the following to the boot() method in RouteServiceProvider (Laravel 8.41.0) worked for me:
if (app()->environment('local')) { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/dev.php')); }
Thanks a lot. I do appreciate it.
Develop faster by adding dev routes file in a Laravel app - Freek Van der Herten's blog on PHP, Laravel and JavaScript
https://freek.dev/1976-develop-faster-by-adding-dev-routes-file-in-a-laravel-app