flexisip-account-manager/flexiapi/app/Rules/IsNotPhoneNumber.php
2025-12-11 16:27:32 +00:00

19 lines
397 B
PHP

<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
use Propaganistas\LaravelPhone\PhoneNumber;
class IsNotPhoneNumber implements Rule
{
public function passes($attribute, $value): bool
{
return (new PhoneNumber($value))->getCountry() == null;
}
public function message()
{
return __('The :attribute should not be a phone number');
}
}