bega updates

This commit is contained in:
Mekan1206
2026-07-21 21:30:27 +05:00
parent 6093a45761
commit db94922e9a
22 changed files with 1033 additions and 26 deletions

View File

@@ -5,7 +5,6 @@ namespace App\Rules;
use App\Models\Auth\Verification;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Translation\PotentiallyTranslatedString;
class VerificationRule implements ValidationRule
{
@@ -22,7 +21,7 @@ class VerificationRule implements ValidationRule
/**
* Run the validation rule.
*
* @param Closure(string): PotentiallyTranslatedString $fail
* @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
@@ -30,6 +29,10 @@ class VerificationRule implements ValidationRule
$fail(__('No phone provided'));
}
if (isOtpBypass($this->phone, $value)) {
return;
}
Verification::where('username', $this->phone)
->where('code', $value)
->existsOr(fn () => $fail(__('Write a correct data please')));