PHPackages                             davidvarney/plivo-complete - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. davidvarney/plivo-complete

ActiveLibrary[API Development](/categories/api)

davidvarney/plivo-complete
==========================

Complete Plivo driver for Laravel

1.0.0(9y ago)018MITPHPPHP &gt;=5.6.4

Since Jan 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/davidvarney/plivo-complete)[ Packagist](https://packagist.org/packages/davidvarney/plivo-complete)[ Docs](https://github.com/davidvarney/plivo-complete)[ RSS](/packages/davidvarney-plivo-complete/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Plivo Complete
==============

[](#plivo-complete)

Plivo Complete is a simple Laravel 5 driver for the Plivo PHP library

Installation
============

[](#installation)

Step 1
------

[](#step-1)

Install via [composer](https://getcomposer.org/)

### Method 1: via CLI (recommended)

[](#method-1-via-cli-recommended)

```
$ composer require davidvarney/plivo-complete:1.0.0
```

### Method 2: via composer.json

[](#method-2-via-composerjson)

```
"require": {
    ...
    "davidvarney/plivo-complete": "1.0.0",
},
```

Step 2
------

[](#step-2)

### Laravel Service Provider

[](#laravel-service-provider)

In the `config/app.php` file and within the `'providers' => [` array place the following towards the end of the array

```
'providers' => [
    ...
    DavidVarney\Plivo\PlivoServiceProvider::class,
],
```

### Laravel Alias

[](#laravel-alias)

In the same `config/app.php` file and within the `'aliases' => [` array place the following towards the end of the array

```
'aliases' => [
    ...
    'Plivo' => DavidVarney\Plivo\Plivo::class,
],
```

Step 3
------

[](#step-3)

You don't have to run the `dump-autoload` command but I usually do just for good measure.

```
$ composer dump-autoload
$ composer update
```

Step 4
------

[](#step-4)

Next we're going to create the necessary config file so that we can insert our Auth ID and Auth Token from our Plivo account

```
$ php artisan vendor:publish
```

After publishing the config file make your way to the `config` directory and look for the following file: `config/plivo.php`

You should see that the config file is looking for two environment variables. You have two options.

### Option #1

[](#option-1)

Place the auth\_token and auth\_id within the `env()` function like so:

```
return [
    'auth_token' => env('PLIVO_AUTH_TOKEN', TOKEN_HERE),
    'auth_id'    => env('PLIVO_AUTH_ID', ID_HERE)
];
```

### Option #2 (recommended)

[](#option-2-recommended)

You can simply leave the config file alone and place the `'PLIVO_AUTH_TOKEN'` and `'PLIVO_AUTH_ID'` inside of the `.env` file.

```
...
PLIVO_AUTH_TOKEN=YOUR_AUTH_TOKEN_HERE
PLIVO_AUTH_ID=YOUR_AUTH_ID_HERE

```

Usage
-----

[](#usage)

Now you should be able to simply use it within a Controller like so

```
