Code Monkey home page Code Monkey logo

appointment-reminders-laravel's Introduction

Twilio

Appointment reminders in PHP with Laravel

Laravel CI

About

This application demostrates how to use the Twilio API to send automated reminders about upcoming appointments.

Read the full tutorial here!

Implementations in other languages:

.NET Java Python Ruby Node
Done Done Done Done Done

Set up

Requirements

Twilio Account Settings

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

Local development

After the above requirements have been met:

  1. Clone this repository and cd into it

    git clone [email protected]:twilio-labs/appointment-reminders-laravel.git
    cd appointment-reminders-laravel
  2. Set your environment variables

    cp .env.example .env

    See Twilio Account Settings to locate the necessary environment variables.

  3. Install dependencies

    make install
  4. Build the frontend assets

    npm run dev
  5. Run the application

    make serve
  6. Navigate to http://localhost:8000

    That's it!

The background scheduler

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

Docker

If you have Docker already installed on your machine, you can use our docker-compose.yml to setup your project.

  1. Make sure you have the project cloned.
  2. Setup the .env file as outlined in the Local Development steps.
  3. Run docker-compose up.

Unit and Integration Tests

You can run the Unit and Feature tests locally by typing:

php artisan test

Cloud deployment

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 Deploy

Resources

  • The CodeExchange repository can be found here.

Contributing

This template is open source and welcomes contributions. All contributions are subject to our Code of Conduct.

License

MIT

Disclaimer

No warranty expressed or implied. Software is as is.

appointment-reminders-laravel's People

Contributors

dependabot-preview[bot] avatar dprothero avatar kwhinnery avatar mcelicalderon avatar patillacode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appointment-reminders-laravel's Issues

Cron Job command

How do i write a cron job command to execute the artisan command in my cpanel?

Artisan Error

Hello, Thank you for this wonderful app.

I tried deploying this app on Heroku and it didn't work Run scripts & scale dynos it just got stucked over here.

Secondly, i tried to run this locally and it showed me the error too :

Adeshs-MacBook-Pro:appointment adeshshah$ php artisan migrate

Warning: require(/Applications/MAMP/htdocs/appointment/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/appointment/bootstrap/autoload.php on line 17

Fatal error: require(): Failed opening required '/Applications/MAMP/htdocs/appointment/bootstrap/../vendor/autoload.php' (include_path='.:') in /Applications/MAMP/htdocs/appointment/bootstrap/autoload.php on line 17
Adeshs-MacBook-Pro:appointment adeshshah$

Please help me resolve this issue.

Thank you,
Adesh

.env file not being loaded

Hi, I've been spending hours on this and haven't figured out how to get this sample app running. I am very interested in Twilio, but so far it isn't as easy as I'd hoped.

I cloned this repo to my Windows 10 machine and (using Git Bash) ran composer update and composer install and editing my .env file and ran this and got this error:

php artisan migrate
PHP Fatal error:  Uncaught RuntimeException: Required environment variable missing, or value not allowed: 'TWILIO_ACCOUNT_SID', 'TWILIO_AUTH_TOKEN', 'TWILIO_SENDING_NUMBER' in F:\code\Twilio\appointment-reminders-laravel\vendor\vlucas\phpdotenv\src\Dotenv.php:122

From various debugging, I've figured out that my .env file is never being loaded.

Do you have any ideas what the problem might be? I appreciate your help.

Code Exchange quality checklist

The purpose of this checklist is to assess the state of this repository, and bring it to an acceptable level for long-term support by completing the tasks listed below.

Please check every part of this checklist for us to process your request. You can do this by marking them with [x] instead of [ ].

Documentation

  • Twilio LICENSE exists in repository

  • Code of Conduct exists in repository

  • CONTRIBUTING exists in repository

  • No broken links in README.md

  • Build status exists at top of README.md

  • Set up steps are complete and accurate

  • CodeExchange repository is linked in README.md

GitHub

  • Dependabot set up

  • Dependabot automerge set up

  • Uses GitHub Actions (required for Twilio sample) or other CI

Code

  • Packages/dependencies are up to date

  • Code compiles against latest packages/dependencies

  • Matches CodeExchange Guidelines to the best of ability

Tests

  • Functionality tests have been created

  • All tests pass

App

  • Confirmed sample behaves as expected (after dependencies have been updated)

  • This file has been copied into a wiki entry for the respective repository or added as a GitHub issue

General

  • I've read and followed the contribution guidelines

  • I've read and implemented my template according to the respective coding guidelines for my project

  • I agree and adhere to the Code of Conduct

  • The template has been authored by me / or my organization and will be kept up-to-date. If the template will not longer be maintained, I'll notify this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.