mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
21 lines
399 B
PHP
21 lines
399 B
PHP
<?php
|
|
|
|
namespace App\Rules;
|
|
|
|
use App\Space;
|
|
|
|
use Illuminate\Contracts\Validation\Rule;
|
|
use Respect\Validation\Validator;
|
|
|
|
class Domain implements Rule
|
|
{
|
|
public function passes($attribute, $value)
|
|
{
|
|
return Validator::regex('/' . Space::DOMAIN_REGEX . '/')->validate($value);
|
|
}
|
|
|
|
public function message()
|
|
{
|
|
return 'The :attribute should be a valid domain';
|
|
}
|
|
}
|