Skip to content

Instantly share code, notes, and snippets.

@vijayrami
Created April 13, 2020 14:08
Show Gist options
  • Select an option

  • Save vijayrami/5b51064b29b9e7d3b054b9b42e2d5525 to your computer and use it in GitHub Desktop.

Select an option

Save vijayrami/5b51064b29b9e7d3b054b9b42e2d5525 to your computer and use it in GitHub Desktop.
Redirect to custom URL after logout on Laravel
<?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