misc_pterodactyl-panel/app/Http/Requests/Admin/LocationFormRequest.php
Matthew Penner cbcf62086f
Upgrade to Laravel 9 (#4413)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
2022-10-14 10:59:20 -06:00

20 lines
447 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);
}
return Location::getRules();
}
}