flexisip-account-manager/flexiapi/app/Rules/PnPrid.php
2025-05-19 07:57:05 +00:00

19 lines
447 B
PHP

<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
use Respect\Validation\Validator;
class PnPrid 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, dashes, underscore and colon characters';
}
}