user = $user; } public function render($request) { $path = $request->getPathInfo(); return response()->json([ 'error' => 'not_authorized', 'message' => 'El usuario ' . $this->user->id . ' no tiene permiso para acceder al endpoint ' . $path ], 401); } }