Skip to content

nexmo-community/laravel-messages

Repository files navigation

Laravel Messages

Nexmo is now known as Vonage

Laravel Messages is a very simple demo app to show a Messages API integration with Laravel 7. It receives and responds to WhatsApp messages, sends Messages to a whitelisted number, and logs the incoming status events.

Welcome to Vonage

If you're new to Vonage, you can sign up for an account and get some free credit to get you started.

Set Up the Project

We've tried to keep things short and sweet!

  • Clone this repo and run composer install (requires PHP 7.3+).
  • Copy .env.example to .env, add your credentials to the NEXMO_* fields at the bottom.
  • Run your application with php artisan serve.
  • If you're working locally, run ngrok to expose the port locally; copy the URL.
  • On the Dashboard, go to the Messages API Sandbox, and whitelist your phone for WhatsApp.
  • On the same page, configure the webhook URLs for incoming messages and status events:
    • incoming messages should be [url you copied earlier]/webhooks/inbound
    • status webhooks should go to [url you copied earlier]/webhooks/status

You're all set!

Run the Project

Visit [url of project]/messages and enter the number of the whitelisted phone (in E163 format, e.g. 447770007777. You should get a WhatsApp message.

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

Further Reading

About

Teeny tiny demo application to show Laravel 7 with Vonage Messages API, specifically using WhatsApp.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published