Use Twilio to receive SMS and MMS messages. For a step-by-step tutorial see the Twilio docs.
First you need to install PHP and Composer.
To run the app locally:
-
Clone this repository and
cd
into itgit clone [email protected]:TwilioDevEd/receive-mms-laravel.git && \ cd receive-mms-laravel
-
Install dependencies
composer install
-
Copy the sample configuration file and edit it to match your configuration
cp .env-example .env
You can find your
TWILIO_ACCOUNT_SID
andTWILIO_AUTH_TOKEN
in your Twilio Account Settings. You will also need aTWILIO_NUMBER
, which you may find here.Run
source .env
to export the environment variables -
Create database file and run migrations:
touch ./database/database.sqlite && \ php artisan migrate --force
-
Run the application
php artisan serve --port 8000
-
Run ngrok:
ngrok http 8000
Be sure to copy the ngrok http url and associate it with your Twilio Phone Number
in your twilio console. The incoming SMS webhook url for
your number should be as follows:
https://<given-ngrok-domain>/api/incoming
- Check it out at http://localhost:8000
That's it
You can run the tests locally by typing
phpunit
- No warranty expressed or implied. Software is as is. Diggity.
- MIT License
- Lovingly crafted by Twilio Developer Education.