Created
April 13, 2020 14:08
-
-
Save vijayrami/5b51064b29b9e7d3b054b9b42e2d5525 to your computer and use it in GitHub Desktop.
Redirect to custom URL after logout on Laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| ..... | |
| use Illuminate\Http\Request; | |
| class LoginController extends Controller | |
| { | |
| ..... | |
| /** | |
| * Logout trait | |
| * | |
| * @author | |
| * @param Request $request | |
| * @return void | |
| */ | |
| protected function logout(Request $request) | |
| { | |
| $this->guard()->logout(); | |
| $request->session()->flush(); | |
| $request->session()->regenerate(); | |
| return redirect()->route('admin.login');/* change your route here*/ | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment