How to logout and redirect to login page using Laravel 5.4?

前端 未结 11 1902
天命终不由人
天命终不由人 2020-12-23 08:58

I am using Laravel 5.4 and trying to implement authentication system. I used php artisan command make:auth to setup it. I edited the views according to my layout. Now, when

11条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-23 09:32

    You can use the following in your controller:

    return redirect('login')->with(Auth::logout());
    

提交回复
热议问题