flexisip-account-manager/flexiapi/app/Rules/IsNotPhoneNumber.php
2022-03-24 17:55:57 +01:00

19 lines
423 B
PHP

<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
use Respect\Validation\Validator;
class IsNotPhoneNumber implements Rule
{
public function passes($attribute, $value): bool
{
return (Validator::not(Validator::phone())->not(Validator::startsWith('+'))->validate($value));
}
public function message()
{
return 'The :attribute should not be a phone number';
}
}