Level 70
May be you can create a custom exception render in the App\Exceptions\Handler class (in the /app/Exceptions/Handler.php file).
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
}
if ($e instanceof TokenMismatchException) {
return redirect(route('login'))->with('message', 'You page session expired. Please try again');
}
return parent::render($request, $e);
}