repository = $repository; } /** * Return a JSON representation of an egg and its variables. * * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException */ public function handle(int $egg): array { $egg = $this->repository->getWithExportAttributes($egg); return [ '_comment' => 'DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO', 'meta' => [ 'version' => 'PTDL_v1', 'update_url' => $egg->update_url, ], 'exported_at' => Carbon::now()->toIso8601String(), 'name' => $egg->name, 'author' => $egg->author, 'description' => $egg->description, 'features' => $egg->features, 'images' => $egg->docker_images, 'file_denylist' => Collection::make($egg->inherit_file_denylist)->filter(function ($value) { return !empty($value); }), 'startup' => $egg->startup, 'config' => [ 'files' => $egg->inherit_config_files, 'startup' => $egg->inherit_config_startup, 'stop' => $egg->inherit_config_stop, ], 'scripts' => [ 'installation' => [ 'script' => $egg->copy_script_install, 'container' => $egg->copy_script_container, 'entrypoint' => $egg->copy_script_entry, ], ], 'variables' => $egg->variables->transform(function (EggVariable $item) { return Collection::make($item->toArray()) ->except(['id', 'egg_id', 'created_at', 'updated_at']) ->toArray(); }), ]; } }