Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Http/Requests/Admin/LocationFormRequest.php
10266 views
1
<?php
2
3
namespace Pterodactyl\Http\Requests\Admin;
4
5
use Pterodactyl\Models\Location;
6
7
class LocationFormRequest extends AdminFormRequest
8
{
9
/**
10
* Set up the validation rules to use for these requests.
11
*/
12
public function rules(): array
13
{
14
if ($this->method() === 'PATCH') {
15
return Location::getRulesForUpdate($this->route()->parameter('location')->id); // @phpstan-ignore property.nonObject
16
}
17
18
return Location::getRules();
19
}
20
}
21
22