All Projects → TwilioDevEd → Eta Notifications Laravel

TwilioDevEd / Eta Notifications Laravel

Licence: mit
GPS tracking implementation with Laravel and Twilio

ETA Notifications for PHP - Laravel

Build Status

ETA notifications implementation with PHP - Laravel and Twilio.

Run the application

  1. Clone the repository and cd into it.

  2. Install the application dependencies with Composer

    $ composer install
    
  3. The application uses PostgreSQL as persistence layer. If you don't have it already, you should install it. The easiest way is by using Postgres.app.

  4. Create a database.

$ createdb eta_notifications
  1. Copy the sample configuration file and edit it to match your configuration.

    $ cp .env.example .env
    

You can find your TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN under your Twilio Account Settings.

You can buy Twilio phone numbers at Twilio numbers TWILIO_NUMBER should be set to the phone number you purchased above.

  1. Generating an APP_KEY:

    $ php artisan key:generate
    
  2. Running the migrations:

    $ php artisan migrate
    
  3. Modifying the seed data:

    We have provided a name and phone number as example in the seed data. In order for the application to send sms notifications, you must edit this seed data providing a valid phone number where you want to receive the sms notifications.

    In order to do this, you must modify this file that is located at: project-root/database/seeds/OrdersTableSeeder.php

  4. Seeding the database:

    $ php artisan db:seed
    
  5. Expose your application to the wider internet using ngrok. You can look here for more details. This step is important because the application won't work as expected if you run it through the localhost.

    $ ngrok http 8000
    
  6. Running the application using Artisan.

$ php artisan serve

Now you can access the application at your ngrok subdomain that should look something like this: http://<subdomain>.ngrok.io

Exposing the Application to the Wider Internet

If you want your application to be accessible from the internet, you can either forward the necessary ports in your router, or use a tool like ngrok that will expose your local host to the internet.

You can read this blog for more details on how to use ngrok, but if you are using version 2.x, exposing a specific port should be easily done with the following command:

$ ngrok http 8000

Dependencies

This application uses this Twilio helper library:

Running the tests

  1. Running at the top-level directory:

    $ phpunit
    

    If you don't have phpunit installed on your system, you can follow these instructions to install it.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].