This application demostrates how to use the Twilio API to send automated reminders about upcoming appointments.
Implementations in other languages:
.NET | Java | Python | Ruby | Node |
---|---|---|---|---|
Done | Done | Done | Done | Done |
- PHP >= 7.2.5 and composer
- Node.js
- A Twilio account - sign up
This application should give you a ready-made starting point for writing your own application. Before we begin, we need to collect all the config values we need to run the application:
Config Value | Description |
---|---|
Account Sid | Your primary Twilio account identifier - find this in the Console. |
Auth Token | Used to authenticate - just like the above, you'll find this here. |
Phone number | A Twilio phone number in E.164 format - you can get one here |
After the above requirements have been met:
-
Clone this repository and
cd
into itgit clone git@github.com:twilio-labs/appointment-reminders-laravel.git cd appointment-reminders-laravel
-
Set your environment variables
cp .env.example .env
See Twilio Account Settings to locate the necessary environment variables.
-
Install dependencies
make install
-
Build the frontend assets
npm run dev
-
Run the application
make serve
-
Navigate to http://localhost:8000
That's it!
The messages are sent using Laravel's scheduler. This requires us to execute php artisan schedule:run
every minute. For development executing the command in an infinite loop should work just fine:
make scheduler
If you have Docker already installed on your machine, you can use our docker-compose.yml
to setup your project.
- Make sure you have the project cloned.
- Setup the
.env
file as outlined in the Local Development steps. - Run
docker-compose up
.
You can run the Unit and Feature tests locally by typing:
php artisan test
Additionally to trying out this application locally, you can deploy it to a variety of host services. Here is a small selection of them.
Please be aware that some of these might charge you for the usage or might make the source code for this application visible to the public. When in doubt research the respective hosting service first.
Service | |
---|---|
Heroku |
- The CodeExchange repository can be found here.
This template is open source and welcomes contributions. All contributions are subject to our Code of Conduct.
No warranty expressed or implied. Software is as is.