repository = $repository; } /** * Return all of the servers available to the client making the API * request, including servers the user has access to as a subuser. * * @param \Pterodactyl\Http\Requests\Api\Client\GetServersRequest $request * @return array */ public function index(GetServersRequest $request): array { $servers = $this->repository ->setSearchTerm($request->input('query')) ->filterUserAccessServers($request->user(), User::FILTER_LEVEL_ALL); return $this->fractal->collection($servers) ->transformWith($this->getTransformer(ServerTransformer::class)) ->toArray(); } }