Path: blob/1.0-develop/app/Http/Controllers/Api/Application/Nests/EggController.php
10277 views
<?php12namespace Pterodactyl\Http\Controllers\Api\Application\Nests;34use Pterodactyl\Models\Egg;5use Pterodactyl\Models\Nest;6use Pterodactyl\Transformers\Api\Application\EggTransformer;7use Pterodactyl\Http\Requests\Api\Application\Nests\Eggs\GetEggRequest;8use Pterodactyl\Http\Requests\Api\Application\Nests\Eggs\GetEggsRequest;9use Pterodactyl\Http\Controllers\Api\Application\ApplicationApiController;1011class EggController extends ApplicationApiController12{13/**14* Return all eggs that exist for a given nest.15*/16public function index(GetEggsRequest $request, Nest $nest): array17{18return $this->fractal->collection($nest->eggs)19->transformWith($this->getTransformer(EggTransformer::class))20->toArray();21}2223/**24* Return a single egg that exists on the specified nest.25*/26public function view(GetEggRequest $request, Nest $nest, Egg $egg): array27{28return $this->fractal->item($egg)29->transformWith($this->getTransformer(EggTransformer::class))30->toArray();31}32}333435