PHPackages                             clevyr/laravel-twilio-channel - 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. clevyr/laravel-twilio-channel

ActiveLibrary

clevyr/laravel-twilio-channel
=============================

A Laravel Notification channel for Twilio

v1.1.1(1y ago)026.5k↓25.2%[2 PRs](https://github.com/clevyr/laravel-twilio-channel/pulls)MITPHPPHP ^8.0CI passing

Since Aug 23Pushed 5mo ago6 watchersCompare

[ Source](https://github.com/clevyr/laravel-twilio-channel)[ Packagist](https://packagist.org/packages/clevyr/laravel-twilio-channel)[ Docs](https://github.com/clevyr/laravel-twilio-channel)[ RSS](/packages/clevyr-laravel-twilio-channel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (13)Versions (10)Used By (0)

Laravel Twilio Channel
======================

[](#laravel-twilio-channel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8fffcd9c8219a05f2d237fa39e3e0246015a983e91c7598aca645ee4b26502c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c657679722f6c61726176656c2d7477696c696f2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/clevyr/laravel-twilio-channel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/e1383f6ba5ff964aafd45593a4ed7e2bd162f2546843184e4449233829c39d95/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f636c657679722f6c61726176656c2d7477696c696f2d6368616e6e656c2f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/clevyr/laravel-twilio-channel/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/725d089148d6965631755df5ca27babb83b53eb97588484440fd8c9577c7e34a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f636c657679722f6c61726176656c2d7477696c696f2d6368616e6e656c2f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/clevyr/laravel-twilio-channel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/fc06f396921b35cee41f5e235004c1e540ad8680e53a0550cbef18c94299b416/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c657679722f6c61726176656c2d7477696c696f2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/clevyr/laravel-twilio-channel)

A Laravel Notification channel for sending SMS messages with [Twilio](https://www.twilio.com/).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require clevyr/laravel-twilio-channel
```

Configure an account on [Twilio](https://www.twilio.com/), and then add the following env vars:

```
TWILIO_SID=
TWILIO_AUTH_TOKEN=
TWILIO_PHONE_NUMBER=

```

Next, publish the config file with:

```
php artisan vendor:publish --provider="Clevyr\LaravelTwilioChannel\LaravelTwilioChannelServiceProvider"
```

This is the contents of the published config file (without descriptive comments):

```
return [
    'sid' => env('TWILIO_SID'),
    'auth_token' => env('TWILIO_AUTH_TOKEN'),
    'phone_number' => env('TWILIO_PHONE_NUMBER'),
];
```

Usage
-----

[](#usage)

In your Laravel notifications:

- Implement the `TwilioNotification` interface
- Add the `TwilioChannel` to your `via` return array value
- Build a `toTwilio` function that returns a `TwilioMessage` object

```
