Laravel Send SMS to Mobile with Nexmo Example
https://www.itsolutionstuff.com/post/laravel-send-sms-to-mobile-with-nexmo-exampleexample.html
Last updated
https://www.itsolutionstuff.com/post/laravel-send-sms-to-mobile-with-nexmo-exampleexample.html
Last updated
By Hardik Savani February 17, 2021 Category : LaravelPlayUnmuteLoaded: 1.17%FullscreenHi,
This tutorial shows you laravel send sms to mobile with nexmo. i would like to share with you how to send sms using nexmo in laravel. This article will give you simple example of send sms using nexmo in laravel. step by step explain laravel sms notification nexmo. You just need to some step to done laravel nexmo message.
In this example, i will give you very simple example to sending sms using nexmo/vonage api in laravel app. you can easily use this code in laravel 6, laravel 7, laravel 8 and laravel 9 app.
let's follow bellow steps:
Step 1: Install Laravel
first of all we need to get fresh Laravel version application using bellow command, So open your terminal OR command prompt and run bellow command:
Step 2: Create Nexmo Account
First you need to create account on nexmo. then you can easily get client id and secret.
Create Account from here: https://dashboard.nexmo.com/sign-in.
you can register and get client id and secret as like bellow:
Add on env file as like bellow:
.env
Read Also: How to create a text file for JSON and file download in Laravel?
Step 3: Install nexmo/client Package
In this step, we need to install nexmo/client composer package to use nexmo api. so let's run bellow command:
Step 4: Create Route
now we will create one route for calling our example, so let's add new route to web.php file as bellow:
routes/web.php
Step 5: Create Controller
in this step, we will create NexmoSMSController and write send sms logic, so let's add new route to web.php file as bellow:
app/Http/Controllers/NexmoSMSController.php
Read Also: How to Send SMS using Twilio in Laravel?
Now you can run and check.
I hope it can help you...
Tags :