Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

cssraja's avatar

SMS Verification

In sign up process im getting user's mobile phone number. I want to send a verification code via SMS to that mobile number which they would have to enter to complete the sign up process.

Any ideas?

0 likes
3 replies
nonuv's avatar

You can do that by following these steps:-

  1. Generate a code and save in session
  2. Send SMS to user
  3. Get input and check with the OTP sent

You can also add a feature to resend which will pull OTP from session and resend it through SMS.

In order to send SMS, you need to use a SMS provider. Usually, SMS providers in your home country can provide better prices as compared to Nexmo / Twillio. In order to integrate them, you can use the Laravel SMS API plugin (https://packagist.org/packages/gr8shivam/laravel-sms-api).

Please or to participate in this conversation.