mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 01:58:07 +00:00
19 lines
397 B
PHP
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');
|
|
}
|
|
}
|