repository = $repository; } /** * Return all eggs that exist for a given nest. * * @param \Pterodactyl\Http\Requests\Api\Application\Nests\Eggs\GetEggsRequest $request * @param \Pterodactyl\Models\Nest $nest * * @return array * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function index(GetEggsRequest $request, Nest $nest): array { $eggs = $this->repository->findWhere([ ['nest_id', '=', $nest->id], ]); return $this->fractal->collection($eggs) ->transformWith($this->getTransformer(EggTransformer::class)) ->toArray(); } /** * Return a single egg that exists on the specified nest. * * @param \Pterodactyl\Http\Requests\Api\Application\Nests\Eggs\GetEggRequest $request * @param \Pterodactyl\Models\Egg $egg * * @return array * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function view(GetEggRequest $request, Egg $egg): array { return $this->fractal->item($egg) ->transformWith($this->getTransformer(EggTransformer::class)) ->toArray(); } }