Level 5
For change the redirect url go to app/Http/Middleware/authenticate.php and then you will found a handle method.In that handle method change the redirect url.
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, I have some route that need to be logged to be seen. This is the code of the routes:
Route::group(['middleware' => 'auth'], function() {
Route::get('string, ['as' => 'user.add_event', 'uses' => 'UserController@addEvent']);
});
It works, but the problem is that if the user is not logged, he is redirected to "login" route, which is not present, instead of being redirected to "auth\login" route.
How can I solve it?
Thanks.
For change the redirect url go to app/Http/Middleware/authenticate.php and then you will found a handle method.In that handle method change the redirect url.
Please or to participate in this conversation.