Not sure why that would throw the same exception... So that's session expire yeah?
Mar 11, 2015
19
Level 20
[L5] Check if session expired
Is there a way I can check if a users session has expired? Then redirect to the login page.
If I stay logged in overnight and refresh the page, I get a TokenMismatchException but I don't want to catch that, because that is the same error you get when posting a form with a bad token.
Level 21
@Swaz Ok so you are getting this error because you dont have any loggedin user. Try this
$router->bind('project', function($id)
{
if(Auth::check()) {
return Auth::user()->company->projects()->findOrFail($id);
}
return redirect('/');
});
Please or to participate in this conversation.