mirror of
https://github.com/pterodactyl/panel.git
synced 2026-02-05 04:03:11 -06:00
21 lines
485 B
PHP
21 lines
485 B
PHP
<?php
|
|
|
|
namespace Pterodactyl\Http\Requests\Admin;
|
|
|
|
use Pterodactyl\Models\Location;
|
|
|
|
class LocationFormRequest extends AdminFormRequest
|
|
{
|
|
/**
|
|
* Set up the validation rules to use for these requests.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
if ($this->method() === 'PATCH') {
|
|
return Location::getRulesForUpdate($this->route()->parameter('location')->id); // @phpstan-ignore property.nonObject
|
|
}
|
|
|
|
return Location::getRules();
|
|
}
|
|
}
|