Skip to content

Commit 7608b42

Browse files
Some work on the readme
1 parent b197acd commit 7608b42

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@ Begin by installing this package through Composer. Run this command from the Ter
1616
```bash
1717
composer require aloha/twilio
1818
```
19-
If you're using Laravel 5.5+, this is all there is to do.
20-
21-
Should you still be on older versions of Laravel, the final steps for you are to add the service provider of the package and alias the package. To do this open your `config/app.php` file.
22-
23-
## Integration for older versions of Laravel (5.5 -)
24-
25-
To wire this up in your Laravel project, you need to add the service provider.
26-
Open `app.php`, and add a new item to the providers array.
27-
28-
```php
29-
'Aloha\Twilio\Support\Laravel\ServiceProvider',
30-
```
3119

3220
This will register two new artisan commands for you:
3321

@@ -46,15 +34,12 @@ line to the `aliases` array if you want to use a short class name:
4634
'Twilio' => 'Aloha\Twilio\Support\Laravel\Facade',
4735
```
4836

49-
In Laravel 4 you can publish the default config file to `app/config/packages/aloha/twilio/config.php` with the artisan command `config:publish aloha/twilio`.
37+
You can publish the default config file to `config/twilio.php` with the artisan command
5038

51-
In Laravel 5 you can publish the default config file to `config/twilio.php` with the artisan command `vendor:publish --tag=config`.
52-
Or to ensure you publish only this package's tag use
5339
```shell
5440
php artisan vendor:publish --tag=config --provider=Aloha\Twilio\Support\Laravel\ServiceProvider
5541
```
5642

57-
5843
#### Facade
5944

6045
The facade has the exact same methods as the `Aloha\Twilio\TwilioInterface`. First, include the `Facade` class at the top of your file:
@@ -101,12 +86,22 @@ $twilio->call('+18085551212', 'http://foo.com/call.xml');
10186
Generating a call and building the message in one go:
10287

10388
```php
104-
$twilio->call('+18085551212', function ($message) {
89+
$twilio->call('+18085551212', function (\Twilio\TwiML\VoiceResponse $message) {
10590
$message->say('Hello');
10691
$message->play('https://api.twilio.com/cowbell.mp3', ['loop' => 5]);
10792
});
10893
```
10994

95+
or to make a call with _any_ Twiml description you can pass along any Twiml object:
96+
97+
```php
98+
$message = new \Twilio\TwiML\VoiceResponse();
99+
$message->say('Hello');
100+
$message->play('https://api.twilio.com/cowbell.mp3', ['loop' => 5]);
101+
102+
$twilio->call('+18085551212', $message);
103+
```
104+
110105
Access the configured `Twilio\Rest\Client` object:
111106

112107
```php
@@ -126,14 +121,14 @@ by adding to the `message` method. All arguments are passed on, and the `from` f
126121

127122
```php
128123
$twilio->message($to, $message, $mediaUrls, $params);
129-
// passes all these arguments on.
124+
// passes all these params on.
130125
```
131126

132127
The same is true for the [call method](https://www.twilio.com/docs/api/voice/call#post-parameters).
133128

134129
```php
135130
$twilio->call($to, $message, $params);
136-
// passes all these arguments on.
131+
// passes all these params on.
137132
```
138133

139134
#### Dummy class

0 commit comments

Comments
 (0)