misc_pterodactyl-panel/app/Http/Requests/Api/Application/Eggs/DeleteEggRequest.php
2021-01-08 09:26:57 -07:00

32 lines
688 B
PHP

<?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;
}
}