json([ 'error' => 'Resource not found' ], 404); } if ($exception instanceof AuthorizationException) { return response()->redirectTo('/'); } return parent::render($request, $exception); } }