This commit is contained in:
2023-12-03 14:43:41 +05:00
parent 09609ef849
commit 21aab6ca7d
6 changed files with 113 additions and 28 deletions

View File

@@ -8,6 +8,15 @@ use Illuminate\Contracts\Validation\ValidationRule;
class PhoneCodeVerification implements ValidationRule
{
/**
* @param int|string $phone
*/
public function __construct(
protected int|string $phone,
) {
}
/**
* Run the validation rule.
*
@@ -15,7 +24,7 @@ class PhoneCodeVerification implements ValidationRule
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
$verification = Verification::where('username', auth()->user()->phone)
$verification = Verification::where('username', $this->phone)
->where('code', $value)
->first();