|
1 | | -Use this repo as a skeleton for your new channel, once you're done please submit a Pull Request on [this repo](https://github.com/laravel-notification-channels/new-channels) with all the files. |
| 1 | +# Twilio notifications channel for Laravel 5.3 [WIP] |
2 | 2 |
|
3 | | -Here's the latest documentation on Laravel 5.3 Notifications System: |
| 3 | +[](https://packagist.org/packages/laravel-notification-channels/twilio) |
| 4 | +[](LICENSE.md) |
| 5 | +[](https://travis-ci.org/laravel-notification-channels/twilio) |
| 6 | +[](https://scrutinizer-ci.com/g/laravel-notification-channels/twilio) |
| 7 | +[](https://packagist.org/packages/laravel-notification-channels/twilio) |
4 | 8 |
|
5 | | -https://laravel.com/docs/master/notifications |
6 | | - |
7 | | -# A Boilerplate repo for contributions |
8 | | - |
9 | | -This package makes it easy to send notifications using [xxxxx](link to service) with Laravel 5.3. |
10 | | - |
11 | | -**Note:** Replace ```:channel_namespace``` ```:author_name``` ```:author_username``` ```:author_website``` ```:author_email``` ```:package_name``` ```:package_description``` with their correct values in [README.md](README.md), [CHANGELOG.md](CHANGELOG.md), [CONTRIBUTING.md](CONTRIBUTING.md), [LICENSE.md](LICENSE.md) and [composer.json](composer.json) files, then delete this line. |
12 | | -This is where your description should go. Add a little code example so build can understand real quick how the package can be used. Try and limit it to a paragraph or two. |
| 9 | +This package makes it easy to send [Twilio notifications](https://documentation.twilio.com/docs) with Laravel 5.3. |
13 | 10 |
|
| 11 | +## Installation |
14 | 12 |
|
| 13 | +You can install the package via composer: |
15 | 14 |
|
16 | | -## Contents |
| 15 | +``` bash |
| 16 | +composer require laravel-notification-channels/twilio |
| 17 | +``` |
17 | 18 |
|
18 | | -- [Installation](#installation) |
19 | | - - [Setting up the xxxx service](#setting-up-the-xxxx-service) |
20 | | -- [Usage](#usage) |
21 | | - - [Available Message methods](#available-message-methods) |
22 | | -- [Changelog](#changelog) |
23 | | -- [Testing](#testing) |
24 | | -- [Security](#security) |
25 | | -- [Contributing](#contributing) |
26 | | -- [Credits](#credits) |
27 | | -- [License](#license) |
| 19 | +You must install the service provider: |
28 | 20 |
|
| 21 | +```php |
| 22 | +// config/app.php |
| 23 | +'providers' => [ |
| 24 | + ... |
| 25 | + NotificationChannels\TwilioNotifications\Provider::class, |
| 26 | +]; |
| 27 | +``` |
29 | 28 |
|
30 | | -## Installation |
| 29 | +## Usage |
31 | 30 |
|
32 | | -Please also include the steps for any third-party service setup that's required for this package. |
| 31 | +Now you can use the channel in your `via()` method inside the notification: |
33 | 32 |
|
34 | | -### Setting up the xxxx service |
| 33 | +``` php |
| 34 | +use NotificationChannels\TwilioNotifications\Channel; |
| 35 | +use NotificationChannels\TwilioNotifications\SmsMessage; |
| 36 | +use Illuminate\Notifications\Notification; |
35 | 37 |
|
36 | | -Optionally include a few steps how users can set up the service. |
| 38 | +class AccountApproved extends Notification |
| 39 | +{ |
| 40 | + public function via($notifiable) |
| 41 | + { |
| 42 | + return [Channel::class]; |
| 43 | + } |
37 | 44 |
|
38 | | -## Usage |
| 45 | + public function toTwilio($notifiable) |
| 46 | + { |
| 47 | + return (new SmsMessage()) |
| 48 | + ->content("Your {$notifiable->service} account was approved!"); |
| 49 | + } |
| 50 | +} |
| 51 | +``` |
39 | 52 |
|
40 | | -Some code examples, make it clear how to use the package |
| 53 | +## Changelog |
41 | 54 |
|
42 | | -### Available methods |
| 55 | +Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. |
43 | 56 |
|
44 | | -A list of all available options |
| 57 | +## Testing |
| 58 | + |
| 59 | +``` bash |
| 60 | +$ composer test |
| 61 | +``` |
45 | 62 |
|
46 | 63 | ## Contributing |
47 | 64 |
|
48 | 65 | Please see [CONTRIBUTING](CONTRIBUTING.md) for details. |
49 | 66 |
|
| 67 | +## Security |
| 68 | + |
| 69 | +If you discover any security related issues, please email [email protected] instead of using the issue tracker. |
| 70 | + |
50 | 71 | ## Credits |
51 | 72 |
|
52 | | -- [:author_name](https://github.com/:author_username) |
| 73 | +- [Gregorio Hernández Caso](https://github.com/gregoriohc) |
53 | 74 | - [All Contributors](../../contributors) |
54 | 75 |
|
55 | 76 | ## License |
|
0 commit comments