bega updates
This commit is contained in:
@@ -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')));
|
||||
|
||||
Reference in New Issue
Block a user