I have a Project Laravel Jetstream with inertia i need change the error page Like This to Vue page
I use https://inertiajs.com/error-handling but not work
public function render($request, Throwable $e)
{
$response = parent::render($request, $e);
if (/*!app()->environment(['local', 'testing']) &&*/in_array($response->status(), [500, 503, 404, 403])) {
return Inertia::render('Error', ['status' => $response->status()])
->toResponse($request)
->setStatusCode($response->status());
} else if ($response->status() === 419) {
return back()->with([
'message' => 'The page expired, please try again.',
]);
}
return $response;
}
This work only in production to work in local
remove !app()->environment(['local', 'testing'])
from the code