api(application): relocate egg endpoints

This commit is contained in:
Matthew Penner 2021-01-08 09:25:40 -07:00
parent 5946210e18
commit 58cfa98b9c
23 changed files with 309 additions and 112 deletions

View file

@ -0,0 +1,32 @@
<?php
namespace Pterodactyl\Http\Requests\Api\Application\Eggs;
use Pterodactyl\Models\Egg;
use Pterodactyl\Services\Acl\Api\AdminAcl;
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
class DeleteEggRequest extends ApplicationApiRequest
{
/**
* @var string
*/
protected $resource = AdminAcl::RESOURCE_EGGS;
/**
* @var int
*/
protected $permission = AdminAcl::WRITE;
/**
* Determine if the requested egg exists on the Panel.
*
* @return bool
*/
public function resourceExists(): bool
{
$egg = $this->route()->parameter('egg');
return $egg instanceof Egg && $egg->exists;
}
}