bega updates
This commit is contained in:
1 parent
6093a45761
commit
db94922e9a
22 files changed
+1033
-26
No files matched your search
@@ -5,7 +5,6 @@
|
||||
use App\Models\Auth\Verification;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Translation\PotentiallyTranslatedString;
|
||||
|
||||
class VerificationRule implements ValidationRule
|
||||
{
|
||||
@@ -22,7 +21,7 @@ public function __construct(protected null|int|string $phone)
|
||||
/**
|
||||
* 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 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||
$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