I am new to Laravel 5 and trying to make a simple authentication page. My problem is i can logout properly after i click to logout link but if i click to back button of the
A method I have used is to simply redirect to the previous page after logout. So long as the previous page was secured, the auth middleware will kick in and redirect you back to the login page. Now when you click the back button the previous page is no longer cached and you just get the login page again.
Original discussion: https://laracasts.com/discuss/channels/requests/back-button-browser
public function logout() {
Auth::logout(); // logout user
return redirect(\URL::previous());
}