2017-06-14 23:53:24 -05:00
|
|
|
<?php
|
2017-09-25 21:43:01 -05:00
|
|
|
/**
|
2017-06-14 23:53:24 -05:00
|
|
|
* Pterodactyl - Panel
|
|
|
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
|
|
|
*
|
2017-09-25 21:43:01 -05:00
|
|
|
* This software is licensed under the terms of the MIT license.
|
|
|
|
* https://opensource.org/licenses/MIT
|
2017-06-14 23:53:24 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
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
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Setup the validation rules to use for these requests.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
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
|
|
|
}
|
|
|
|
}
|