misc_pterodactyl-panel/app/Http/Requests/Admin/Node/NodeFormRequest.php
Matthew Penner 95e15d2c8a
Cleanup FQDN validation logic, fallback to old hostname check (#4409)
Co-authored-by: DaneEveritt <dane@daneeveritt.com>
2022-10-09 16:19:16 -06:00

25 lines
564 B
PHP

<?php
namespace Pterodactyl\Http\Requests\Admin\Node;
use Pterodactyl\Rules\Fqdn;
use Pterodactyl\Models\Node;
use Pterodactyl\Http\Requests\Admin\AdminFormRequest;
class NodeFormRequest extends AdminFormRequest
{
/**
* Get rules to apply to data in this request.
*/
public function rules()
{
if ($this->method() === 'PATCH') {
return Node::getRulesForUpdate($this->route()->parameter('node'));
}
$data = Node::getRules();
$data['fqdn'][] = Fqdn::make('scheme');
return $data;
}
}