2017-08-05 22:20:07 +00:00
|
|
|
<?php
|
|
|
|
|
2017-08-06 02:10:32 +00:00
|
|
|
namespace Pterodactyl\Http\Requests\Admin\Node;
|
2017-08-05 22:20:07 +00:00
|
|
|
|
2022-10-09 22:19:16 +00:00
|
|
|
use Pterodactyl\Rules\Fqdn;
|
2017-08-05 22:20:07 +00:00
|
|
|
use Pterodactyl\Models\Node;
|
2017-08-06 02:10:32 +00:00
|
|
|
use Pterodactyl\Http\Requests\Admin\AdminFormRequest;
|
2017-08-05 22:20:07 +00:00
|
|
|
|
|
|
|
class NodeFormRequest extends AdminFormRequest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Get rules to apply to data in this request.
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
if ($this->method() === 'PATCH') {
|
2019-09-05 05:26:28 +00:00
|
|
|
return Node::getRulesForUpdate($this->route()->parameter('node'));
|
2017-08-05 22:20:07 +00:00
|
|
|
}
|
|
|
|
|
2022-10-09 22:19:16 +00:00
|
|
|
$data = Node::getRules();
|
|
|
|
$data['fqdn'][] = Fqdn::make('scheme');
|
2017-08-05 22:20:07 +00:00
|
|
|
|
2022-10-09 22:19:16 +00:00
|
|
|
return $data;
|
2017-08-05 22:20:07 +00:00
|
|
|
}
|
|
|
|
}
|