Answer the question
In order to leave comments, you need to log in
How to store temporary code in Laravel?
there is a front part and api separately on Laravel
there is a functionality for sending code to the phone from the backend I
send the phone number to the backend, I generate the code, I save this code to the session
$code = rand(1000,9999);
Session::put('sms_code', $code);
$message = $message . $code;
return [
'error' => false,
'message' => 'Код отправлен на номер телефона'
];
if (Session::has('sms_code') && (int)Session::get('sms_code') == $code){
Session::forget('sms_code');
return [
'error' => false
];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question