I want to redirect back to where the user was after he logged out successfully, because I have methods that are available even when logging out.
I protect every method in PhotosController except @show
public function __construct()
{
$this->middleware('auth', ['except' => 'show']);
}
To set the redirection after logging out, I set the property in my AuthController as follows:
protected $redirectAfterLogout = '/customLogoutPage';
But I want to redirect the user back to where he was, since he can see the view even without blocking.
I tried something in this direction:
protected $redirectAfterLogout = redirect()->back();
But my browser says: "Unexpected" (', waiting', 'or'; '
, , .