2018-01-27 18:38:56 +00:00
|
|
|
<?php
|
|
|
|
|
2021-01-08 16:25:40 +00:00
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Eggs;
|
2018-01-27 18:38:56 +00:00
|
|
|
|
2018-02-24 17:11:57 +00:00
|
|
|
use Pterodactyl\Models\Egg;
|
2018-01-27 18:38:56 +00:00
|
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
|
|
|
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
|
|
|
|
2021-01-08 16:25:40 +00:00
|
|
|
class DeleteEggRequest extends ApplicationApiRequest
|
2018-01-27 18:38:56 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $resource = AdminAcl::RESOURCE_EGGS;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
2021-01-08 16:25:40 +00:00
|
|
|
protected $permission = AdminAcl::WRITE;
|
2018-01-27 18:38:56 +00:00
|
|
|
|
|
|
|
/**
|
2021-01-08 16:25:40 +00:00
|
|
|
* Determine if the requested egg exists on the Panel.
|
2018-01-27 18:38:56 +00:00
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function resourceExists(): bool
|
|
|
|
{
|
2021-01-08 16:25:40 +00:00
|
|
|
$egg = $this->route()->parameter('egg');
|
|
|
|
|
|
|
|
return $egg instanceof Egg && $egg->exists;
|
2018-01-27 18:38:56 +00:00
|
|
|
}
|
|
|
|
}
|