Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sokhomhuy/40c0db8be7daaa018234eb32003ed932 to your computer and use it in GitHub Desktop.
Save sokhomhuy/40c0db8be7daaa018234eb32003ed932 to your computer and use it in GitHub Desktop.
Laravel : The page has expired due to inactivity. Please refresh and try again.
please check this out by update app->Exceptions->Handler.php
public function render($request, Exception $exception)
{
if ($exception instanceof \Illuminate\Session\TokenMismatchException)
{
return redirect()
->back()
->withInput($request->except('password'))
->with([
'message' => 'Validation Token was expired. Please try again',
'message-type' => 'danger']);
}
return parent::render($request, $exception);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment