For a more up-to-date version with WhatsApp and Laravel 7, try this: https://github.com/nexmo-community/laravel-messages
Clone the repo:
git clone [email protected]:nexmo-community/laravel-sms.git cd laravel-sms
Add configuration information to
... NEXMO_API_KEY=YOUR_KEY NEXMO_API_SECRET=YOUR_SECRET NEXMO_NUMBER=YOUR_NUMBER
Set your application key to a random string:
php artisan key:generate
Start the Laravel application:
php artisan serve
ngrok http 8000
Link your Nexmo phone number to the
/sms/receive webhook endpoint. Replace
YOUR_NUMBER with your Nexmo registered number and
NGROK_SUBDOMAIN with the subdomain assigned to you by ngrok in the previous command:
nexmo link:sms YOUR_NUMBER https://NGROK_SUBDOMAIN.ngrok.io/sms/receive
NUMBER with a real number in order to send an SMS to that number.
Send an SMS to the Nexmo registered
YOUR_NUMBER in order to send a message to the Laravel application and get an auto-reply.
For detailed instructions please see the tutorial.
Published on Laravel News: https://laravel-news.com/sending-receiving-sms-laravel-nexmo