Files
online.tbbank.gov.tm-larave…/app/Rules/DowranAgaAllowed.php

24 lines
588 B
PHP

<?php
namespace App\Rules;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
class DowranAgaAllowed implements ValidationRule
{
/**
* Run the validation rule.
*
* @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
$pattern = "/^[a-zA-Z0-9\s\(\)\"\'\-\žŽäÄňŇöÖşŞüÜçÇýÝ\/,]+$/u";
if (! preg_match($pattern, $value)) {
$fail(__('Write a correct data please'));
}
}
}