otp working
This commit is contained in:
@@ -23,13 +23,13 @@ class VerificationController extends Controller
|
||||
'phone.regex' => 'The phone number must be in the format: +993 KX XX XX XX (where K is 6 or 7).'
|
||||
]);
|
||||
|
||||
$phone = $request->phone;
|
||||
$phone = unmask_phone($request->phone);
|
||||
|
||||
// Generate a 4-digit OTP
|
||||
$otp = (string) rand(1000, 9999);
|
||||
|
||||
// Log it to simulate SMS
|
||||
Log::info("OTP for {$phone} is {$otp}");
|
||||
Log::info('Tassyklaýyş belgi: ' . $otp);
|
||||
|
||||
// Store in DB
|
||||
PhoneVerification::updateOrCreate(
|
||||
@@ -41,6 +41,8 @@ class VerificationController extends Controller
|
||||
]
|
||||
);
|
||||
|
||||
sendSMS($phone, $otp);
|
||||
|
||||
// Store phone in session for the next step
|
||||
session()->put('verify_phone', $phone);
|
||||
|
||||
@@ -49,7 +51,7 @@ class VerificationController extends Controller
|
||||
|
||||
public function verifyForm()
|
||||
{
|
||||
if (!session()->has('verify_phone')) {
|
||||
if (! session()->has('verify_phone')) {
|
||||
return redirect()->route('verification.index');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user