repository = $repository; } /** * Lists all of the allocations available to a server and wether or * not they are currently assigned as the primary for this server. * * @param \Pterodactyl\Http\Requests\Api\Client\Servers\Network\GetNetworkRequest $request * @param \Pterodactyl\Models\Server $server * @return array */ public function index(GetNetworkRequest $request, Server $server): array { $allocations = $this->repository->findWhere([ ['server_id', '=', $server->id], ]); return $this->fractal->collection($allocations) ->transformWith($this->getTransformer(AllocationTransformer::class)) ->toArray(); } }