Register page should work
This commit is contained in:
1 parent
71da05f019
commit
306ee0f8a5
10 files changed
+87
-7
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Rules;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
|
||||
class PhoneCodeVerification implements ValidationRule
|
||||
{
|
||||
/**
|
||||
* Run the validation rule.
|
||||
*
|
||||
* @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
|
||||
*/
|
||||
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||
{
|
||||
$verification = Verification::where('username', auth()->user()->phone)
|
||||
->where('code', $request->verification_code)
|
||||
->first();
|
||||
|
||||
if (! $verification) {
|
||||
$fail(__('Write a correct data please'));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user