Gamestar
Gamestar

Reputation: 55

Laravel 6 not returning 404 when calling a not existing route

I have some issues with Laravel. I called php artisan route:cache and then the issues began. For example, the Auth routes (login etc.) can be called even if the User is logged in. Then the caching command seems to not clearing the routes. I noticed it because I put my Auth routes in the middleware guests because of the rendering of the Auth routes. After I ran route: clear it worked.

Also, the 404 routing doesn't work since that, because if I call a route that doesn't exist, then the Symfony Framework throws an error:

Symfony\Component\Routing\Exception\ResourceNotFoundException

That's my web.php:

Route::get("/installer","install\InstallController@index");

Route::group(["middleware"=>"guest"],function(){
    Auth::routes();
    Route::post("login","Auth\Logincontroller@authenticate");
});

Route::group(["middleware" => "auth"], function () {
    Route::get("/logout","Auth\LoginController@logOut");
    Route::get('/', "dashboard\DashboardController@index");
});

Also, the installer route doesn't work. I will always get redirected to localhost/dashboard (even if I change the route name). My domain for the Laravel is called raptor.debug, so I don't know why it's redirecting to localhost.

Can someone point out what I did wrong or is this a bug?

Upvotes: 1

Views: 167

Answers (1)

Gamestar
Gamestar

Reputation: 55

As Anas Bakro pointed out, the command php artisan route:cache will brick the app, when the folder of the controllers are lowercased.

Upvotes: 1

Related Questions