2018-01-27 18:38:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Api\Application\Nests\Eggs;
|
|
|
|
|
2018-02-24 17:11:57 +00:00
|
|
|
use Pterodactyl\Models\Egg;
|
|
|
|
use Pterodactyl\Models\Nest;
|
2018-01-27 18:38:56 +00:00
|
|
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
|
|
|
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
|
|
|
|
|
|
|
class GetEggRequest extends ApplicationApiRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $resource = AdminAcl::RESOURCE_EGGS;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
protected $permission = AdminAcl::READ;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Determine if the requested egg exists for the selected nest.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function resourceExists(): bool
|
|
|
|
{
|
2018-02-24 17:11:57 +00:00
|
|
|
return $this->getModel(Nest::class)->id === $this->getModel(Egg::class)->nest_id;
|
2018-01-27 18:38:56 +00:00
|
|
|
}
|
|
|
|
}
|