Merkez validations

This commit is contained in:
2023-11-28 20:35:01 +05:00
parent af9afd5113
commit 5b32575929
6 changed files with 72 additions and 41 deletions

View File

@@ -0,0 +1,23 @@
<?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'));
}
}
}