How to change default redirect URL of Laravel 5 Auth filter?

后端 未结 10 1907
终归单人心
终归单人心 2020-12-04 20:17

By default if I am not logged and I try visit this in browser:

http://localhost:8000/home

It redirect me to http://localhost:8000/aut

10条回答
  •  庸人自扰
    2020-12-04 20:30

    Since your other question was marked as duplicate..I will try to answer it here..

    First you need to change your route like

     'login',
        'uses' => 'Auth\AuthController@getLogin'
    ]);
    

    In your blade..make sure you use named route in the Login url link like

    {{ route('login') }}
    

    In Middleware/Authenticate.php change the redirect guest to

    return redirect()->guest(config('constants.cms_path') . '/login');
    

提交回复
热议问题