Files
pterodactyl-panel/app/Validation/DatabaseHostRules.php
T

26 lines
688 B
PHP
Raw Normal View History

2026-10-05 18:10:18 -04:00
<?php
declare(strict_types=1);
namespace Pterodactyl\Validation;
final class DatabaseHostRules
{
/**
* Validation rules for the database host requests.
*
* @return NormalizedValidationRules
*/
public static function rules(): array
{
return [
'name' => ['required', 'string', 'max:191'],
'host' => ['required', 'string', 'regex:/^[\w\-\.]+$/'],
'port' => ['required', 'numeric', 'between:1,65535'],
'username' => ['required', 'string', 'max:32'],
'password' => ['nullable', 'string'],
'node_id' => ['sometimes', 'nullable', 'integer', 'exists:nodes,id'],
];
}
}