Files
pterodactyl-panel/app/Validation/LocationRules.php
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

26 lines
650 B
PHP

<?php
declare(strict_types=1);
namespace Pterodactyl\Validation;
use Illuminate\Validation\Rule;
use Pterodactyl\Models\Location;
final class LocationRules
{
/**
* Validation rules for the location requests and p:location:make.
*
* @param Location|null $ignore the location being updated
* @return NormalizedValidationRules
*/
public static function rules(?Location $ignore = null): array
{
return [
'short' => ['required', 'string', 'between:1,60', Rule::unique('locations', 'short')->ignore($ignore)],
'long' => ['string', 'nullable', 'between:1,191'],
];
}
}