Download the PHP package j42/laravel-twilio without Composer

On this page you can find all versions of the php package j42/laravel-twilio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-twilio

laravel-twilio

A Twilio port for Laravel (5.1+)

Install

Add the package to your composer.json and run composer update:

{
  "require": {
    ...
    "j42/laravel-twilio": "dev-master"
  }
}

Then add the service providers and facades to config/app.php

...

Configure

Generate the package config files by running php artisan config:publish j42/laravel-twilio, and adjust the relevant fields:

Phone Verification

Since phone verification is such a common use case, I created a simple flow to automate this.

This package automatically installs the following routes (GET or POST allowed):

/twilio/verify

Request a Token

Initiate an HTTP GET or POST request to /twilio/verify with the following parameters:

The numeric token is set in a cookie and has a 2 minute TTL during which it is valid.

Returns:

Verify a Token

Initiate an HTTP GET or POST re uest to /twilio/verify/ with the following parameters:

If properly verified, the full object will be returned:

Post-Verification (Success)

Once the code has been confirmed, the verified data is available via Cookie with a 5 minute TTL. An HTTP request to /twilio/verify (with or without any parameters) will return:

Advanced Usage

Sometimes you may need to handle additional logic in a controller of your own. By including a handy interface, this becomes easy:

Define the route overrides (whichever suits your preference, or, both)

Create your controller, extending J42\LaravelTwilio\TwilioVerify

Define your functionality as needed, making sure to call parent::verify(); to handle the default events. If you need to access the cookie directly you may do so via: Cookie::get('twilio::phone').

SMS

How to interact with Twilio's REST-based SMS methods.

Send an SMS

Call

How to interact with Twilio's REST-based call initiation methods.

Initiate a Call (TWIML Endpoint)

Request Local Numbers

You can also request local numbers (to be used in the 'from' field) via any of the attributes available in the SDK client. Currently US only. If you want to adapt this (feel free to fork it) you may do so easily by abstracting the geoList parameters to the configuration file.

numbersNear accepts 3 arguments:

By Regex

A pattern to match phone numbers on. Valid characters are '' and [0-9a-zA-Z]. The '' character will match any single digit. See Example 2 and Example 3 below.

Purchasing Numbers

Purchasing numbers is easy. Just pass an array of phone #s you would like to buy to the buyNumbers method.

Associating #s with TWIML (VoiceUrl/SmsUrl)

You can work with number resources by assigning them to TWIML endpoints for various services (voice, sms), as well as integrate and remove other features. This is as simple as calling update with a number resource (an array of numbers, which include sid properties -- this includes all responses returned from this library).

You can learn more about the "incoming phone numbers" resource via the Twilio Docs


All versions of laravel-twilio with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
twilio/sdk Version 3.12.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package j42/laravel-twilio contains the following files

Loading the files please wait ....