Register page should work

This commit is contained in:
2023-12-02 14:36:38 +05:00
parent 71da05f019
commit 306ee0f8a5
10 changed files with 87 additions and 7 deletions

View File

@@ -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'));
}
}
}