触发回退路由
// App\Exceptions\Handler
public function render($request, Exception $exception) {
if ($exception instanceof ModelNotFoundException && $request->isJson()) {
return Route::respondWithRoute('api.fallback.404');
}
return parent::render($request, $exception);
}Last updated