2017-06-14 23:53:24 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Requests\Admin;
|
|
|
|
|
|
|
|
use Pterodactyl\Models\Location;
|
|
|
|
|
2017-08-05 21:10:32 -05:00
|
|
|
class LocationFormRequest extends AdminFormRequest
|
2017-06-14 23:53:24 -05:00
|
|
|
{
|
|
|
|
/**
|
2022-10-14 10:59:20 -06:00
|
|
|
* Set up the validation rules to use for these requests.
|
2017-06-14 23:53:24 -05:00
|
|
|
*/
|
2022-10-14 10:59:20 -06:00
|
|
|
public function rules(): array
|
2017-06-14 23:53:24 -05:00
|
|
|
{
|
2017-06-24 19:49:09 -05:00
|
|
|
if ($this->method() === 'PATCH') {
|
2019-09-04 22:26:28 -07:00
|
|
|
return Location::getRulesForUpdate($this->route()->parameter('location')->id);
|
2017-06-24 19:49:09 -05:00
|
|
|
}
|
|
|
|
|
2019-09-04 22:26:28 -07:00
|
|
|
return Location::getRules();
|
2017-06-14 23:53:24 -05:00
|
|
|
}
|
|
|
|
}
|