$model->id, 'uuid' => $model->uuid, 'name' => $model->name, 'description' => $model->description, 'source' => $model->source, 'target' => $model->target, 'read_only' => $model->read_only, 'user_mountable' => $model->user_mountable, ]; } /** * Return the eggs associated with this mount. * * @param \Pterodactyl\Models\Mount $mount * * @return \League\Fractal\Resource\Collection|\League\Fractal\Resource\NullResource * @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function includeEggs(Mount $mount) { if (! $this->authorize(AdminAcl::RESOURCE_EGGS)) { return $this->null(); } $mount->loadMissing('eggs'); return $this->collection( $mount->getRelation('eggs'), $this->makeTransformer(EggTransformer::class), Egg::RESOURCE_NAME ); } /** * Return the nodes associated with this mount. * * @param \Pterodactyl\Models\Mount $mount * * @return \League\Fractal\Resource\Collection|\League\Fractal\Resource\NullResource * @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function includeNodes(Mount $mount) { if (! $this->authorize(AdminAcl::RESOURCE_NODES)) { return $this->null(); } $mount->loadMissing('nodes'); return $this->collection( $mount->getRelation('nodes'), $this->makeTransformer(NodeTransformer::class), Node::RESOURCE_NAME ); } /** * Return the servers associated with this mount. * * @param \Pterodactyl\Models\Mount $mount * * @return \League\Fractal\Resource\Collection|\League\Fractal\Resource\NullResource * @throws \Pterodactyl\Exceptions\Transformer\InvalidTransformerLevelException * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function includeServers(Mount $mount) { if (! $this->authorize(AdminAcl::RESOURCE_SERVERS)) { return $this->null(); } $mount->loadMissing('servers'); return $this->collection( $mount->getRelation('servers'), $this->makeTransformer(ServerTransformer::class), Server::RESOURCE_NAME ); } }