mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 18:08:06 +00:00
19 lines
435 B
PHP
19 lines
435 B
PHP
<?php
|
|
|
|
namespace App\Rules;
|
|
|
|
use Illuminate\Contracts\Validation\Rule;
|
|
use Respect\Validation\Validator;
|
|
|
|
class PnParam implements Rule
|
|
{
|
|
public function passes($attribute, $value)
|
|
{
|
|
return $value == null || Validator::regex('/^[\w\.]+$/')->validate($value);
|
|
}
|
|
|
|
public function message()
|
|
{
|
|
return 'The :attribute should be null or contain only alphanumeric, dots and underscore characters';
|
|
}
|
|
}
|