toArray(); $response[$model->getUpdatedAtColumn()] = $this->formatTimestamp($model->updated_at); $response[$model->getCreatedAtColumn()] = $this->formatTimestamp($model->created_at); return $response; } /** * Include the Eggs relationship on the given Nest model transformation. * * @param \Pterodactyl\Models\Nest $model * @return \League\Fractal\Resource\Collection|\League\Fractal\Resource\NullResource * * @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException */ public function includeEggs(Nest $model) { if (! $this->authorize(AdminAcl::RESOURCE_EGGS)) { return $this->null(); } $model->loadMissing('eggs'); return $this->collection($model->getRelation('eggs'), $this->makeTransformer(EggTransformer::class), Egg::RESOURCE_NAME); } /** * Include the servers relationship on the given Nest model. * * @param \Pterodactyl\Models\Nest $model * @return \League\Fractal\Resource\Collection|\League\Fractal\Resource\NullResource * * @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException */ public function includeServers(Nest $model) { if (! $this->authorize(AdminAcl::RESOURCE_SERVERS)) { return $this->null(); } $model->loadMissing('servers'); return $this->collection($model->getRelation('servers'), $this->makeTransformer(ServerTransformer::class), Server::RESOURCE_NAME); } }