mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
20 lines
431 B
PHP
20 lines
431 B
PHP
<?php
|
|
|
|
namespace App\Rules;
|
|
|
|
use Illuminate\Contracts\Validation\Rule;
|
|
use Respect\Validation\Validator;
|
|
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');
|
|
}
|
|
}
|