add visa/master module

This commit is contained in:
2024-09-04 19:50:40 +05:00
parent be39810f62
commit 837d2a4704
17 changed files with 476 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ use Illuminate\Contracts\Validation\ValidationRule;
class PhoneCodeVerification implements ValidationRule
{
public function __construct(
protected int|string $phone,
protected null|int|string $phone,
) {}
/**
@@ -19,6 +19,12 @@ class PhoneCodeVerification implements ValidationRule
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
if (is_null($this->phone)) {
$fail(__('Could not parse phone number'));
return;
}
$verification = Verification::where('username', $this->phone)
->where('code', $value)
->first();