toArray(); } /** * Return the nodes associated with this location. * * @param \Pterodactyl\Models\Location $location * @return bool|\League\Fractal\Resource\Collection * * @throws \Pterodactyl\Exceptions\PterodactylException */ public function includeServers(Location $location) { if (! $this->authorize('server-list')) { return false; } if (! $location->relationLoaded('servers')) { $location->load('servers'); } return $this->collection($location->getRelation('servers'), new ServerTransformer($this->getRequest()), 'server'); } /** * Return the nodes associated with this location. * * @param \Pterodactyl\Models\Location $location * @return bool|\League\Fractal\Resource\Collection * * @throws \Pterodactyl\Exceptions\PterodactylException */ public function includeNodes(Location $location) { if (! $this->authorize('node-list')) { return false; } if (! $location->relationLoaded('nodes')) { $location->load('nodes'); } return $this->collection($location->getRelation('nodes'), new NodeTransformer($this->getRequest()), 'node'); } }