finishes 13 and 14
This commit is contained in:
@@ -22,5 +22,19 @@
|
||||
]);
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions): void {
|
||||
//
|
||||
$exceptions->respond(function (\Symfony\Component\HttpFoundation\Response $response, \Throwable $exception, \Illuminate\Http\Request $request) {
|
||||
if (! app()->environment('local') && in_array($response->getStatusCode(), [403, 404, 500, 503])) {
|
||||
return \Inertia\Inertia::render('ErrorPage', ['status' => $response->getStatusCode()])
|
||||
->toResponse($request)
|
||||
->setStatusCode($response->getStatusCode());
|
||||
}
|
||||
|
||||
if ($response->getStatusCode() === 419) {
|
||||
return back()->with([
|
||||
'message' => 'The page expired, please try again.',
|
||||
]);
|
||||
}
|
||||
|
||||
return $response;
|
||||
});
|
||||
})->create();
|
||||
|
||||
Reference in New Issue
Block a user