33 lines
714 B
PHP
33 lines
714 B
PHP
|
<?php
|
||
|
|
||
|
namespace Pterodactyl\Http\Requests\API\Admin\Locations;
|
||
|
|
||
|
use Pterodactyl\Models\Location;
|
||
|
use Pterodactyl\Services\Acl\Api\AdminAcl;
|
||
|
use Pterodactyl\Http\Requests\API\Admin\ApiAdminRequest;
|
||
|
|
||
|
class DeleteLocationRequest extends ApiAdminRequest
|
||
|
{
|
||
|
/**
|
||
|
* @var string
|
||
|
*/
|
||
|
protected $resource = AdminAcl::RESOURCE_LOCATIONS;
|
||
|
|
||
|
/**
|
||
|
* @var int
|
||
|
*/
|
||
|
protected $permission = AdminAcl::WRITE;
|
||
|
|
||
|
/**
|
||
|
* Determine if the requested location exists on the Panel.
|
||
|
*
|
||
|
* @return bool
|
||
|
*/
|
||
|
public function resourceExists(): bool
|
||
|
{
|
||
|
$location = $this->route()->parameter('location');
|
||
|
|
||
|
return $location instanceof Location && $location->exists;
|
||
|
}
|
||
|
}
|