Laravel 6自定义auth logout后的跳转链接:
方法一:
修改 Auth/LoginController.php
添加:
use IlluminateHttpRequest;
将:
use AuthenticatesUsers;
修改为:
use AuthenticatesUsers{ logout as performLogout; }
新增 Logout 方法:
public function logout(Request $request) { $this->performLogout($request); return redirect()->route('login'); }
方法二:
修改 Auth/LoginController.php
添加:
use IlluminateHttpRequest;
新增 logout 方法:
public function logout(Request $request) $this->guard()->logout(); $request->session()->flush(); $request->session()->regenerate(); return redirect('/'); }
本文为原创文章,版权归主机之家测评所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ Laravel Passport 提示 Class 'AppProvidersPassport' not found 错误的解决办法07/07
- ♥ Laravel 提示 Warning: No such file or directory in D:WWWXXXvendorcomposerautoload_real.php 错误07/06
- ♥ Laravel 提示 The GET method is not supported for this route. Supported methods: POST.错误的解决办法07/07
- ♥ Laravel Passport unsupported_grant_type 的错误解决办法07/07
- ♥ 禁止 Windows10 系统自动更新的两种方法08/29
- ♥ Bootstrap Table 去掉分页信息中“每页显示 N 条记录”文字的方法07/06