shouldReport($e)) { app('sentry')->captureException($e); } parent::report($e); } /** * 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) { // hopefully catches those pesky token expiries // and send them back to login. if ($e instanceof TokenMismatchException) { return redirect()->route('login'); } return parent::render($request, $e); } }