[ 'Content-Type' => 'application/json', ], ]); $guzzle->post( config('logging.slack'), [ 'body' => json_encode([ 'attachments' => [[ 'fallback' => 'There was an exception.', 'pretext' => 'There was an exception.', 'color' => '#d00000', 'author_name' => app()->environment(), 'author_link' => config('app.url'), 'fields' => [[ 'title' => get_class($throwable) ?? 'Unknown Exception', 'value' => $throwable->getTraceAsString() ?? '', ]], 'ts' => time(), ]], ]), ] ); } /** * Render an exception into an HTTP response. * * @param Request $request * @param Throwable $throwable * @return Response * @throws Throwable */ public function render($request, Throwable $throwable) { if ($throwable instanceof TokenMismatchException) { Route::getRoutes()->match($request); } return parent::render($request, $throwable); } }