Files
WMS/Modules/Countries/Rules/ValidCountryCode.php
T
2026-09-21 10:14:57 +01:00

17 lines
440 B
PHP
Executable File

<?php
namespace Modules\Countries\Rules;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
class ValidCountryCode implements ValidationRule
{
public function __construct(private readonly bool $activeOnly = true) {}
public function validate(string $attribute, mixed $value, Closure $fail): void
{
(new ValidIso3166CountryCode($this->activeOnly, 'alpha2'))->validate($attribute, $value, $fail);
}
}