Refactor imports and formatting in various Filament resources; add SMS sending helper function

This commit is contained in:
2025-09-22 16:31:13 +05:00
parent 60afe0c441
commit f14defeebd
27 changed files with 251 additions and 85 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Modules\PhoneNumberVerification\Rules;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
class PhoneNumberVerificationRule implements ValidationRule
{
/**
* Run the validation rule.
*
* @param \Closure(string, ?string=): \Illuminate\Translation\PotentiallyTranslatedString $fail
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
if (! is_numeric($value)) {
$fail('Telefon belgisi diňe sanlardan ybarat bolmaly.');
return;
}
$number = (int) $value;
$isValid = ($number >= 61000000 && $number <= 65999999) || ($number >= 71000000 && $number <= 71999999);
if (! $isValid) {
$fail('Telefon belgisi nädogry aralykda.');
}
}
}