fractal = $fractal; $this->repository = $repository; $this->config = $config; } /** * Handle request to list all users on the panel. * * @param \Illuminate\Http\Request $request * @return array */ public function index(Request $request) { $users = $this->repository->all($this->config->get('pterodactyl.paginate.api.users')); $fractal = $this->fractal->collection($users) ->transformWith(new UserTransformer($request)) ->withResourceName('user') ->paginateWith(new IlluminatePaginatorAdapter($users)); if ($this->config->get('pterodactyl.api.include_on_list') && $request->input('include')) { $fractal->parseIncludes(explode(',', $request->input('include'))); } return $fractal->toArray(); } }