PHPackages                             canerdogan/twilio-notification-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. canerdogan/twilio-notification-channel

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

canerdogan/twilio-notification-channel
======================================

A boilerplate for contributions.

2.0.4(8y ago)010MITPHPPHP &gt;=5.6.4

Since Aug 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/canerdogan/twilio)[ Packagist](https://packagist.org/packages/canerdogan/twilio-notification-channel)[ Docs](https://github.com/canerdogan/twilio)[ RSS](/packages/canerdogan-twilio-notification-channel/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (7)Versions (11)Used By (0)

Twilio notifications channel for Laravel 5.3+
=============================================

[](#twilio-notifications-channel-for-laravel-53)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5d6ec37f4caeabe5c071208e59b126880fba46f7b43e7ee6f297ea200dea4bf9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7477696c696f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/twilio)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/7c8a1498f38e1d1ad04418da0dda0773733eb5e0acae4e10ad28d161c4623458/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7477696c696f2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/laravel-notification-channels/twilio)[![StyleCI](https://camo.githubusercontent.com/33a97da6ff9ecb88f5319fb154577a547442e8a889d897498883f7bb32eb486e/68747470733a2f2f7374796c6563692e696f2f7265706f732f36353534333333392f736869656c64)](https://styleci.io/repos/65543339)[![Quality Score](https://camo.githubusercontent.com/bebfb8062f6f751ecc4ef723ff002d230d1e7e16b78a64658ddc19a4665285f0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7477696c696f2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/twilio)[![Code Coverage](https://camo.githubusercontent.com/9bd0ad108a6b971cbcd62b09ca7e52d120ef3e9b8772222265c83a95a97885eb/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7477696c696f2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/twilio/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/9cd42cec08daf4da377b6ec8e91d588eee765431cd6498570ec3ab9b936dfaec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7477696c696f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/twilio)

This package makes it easy to send [Twilio notifications](https://documentation.twilio.com/docs) with Laravel 5.3.

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up your Twilio account](#setting-up-your-twilio-account)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require laravel-notification-channels/twilio
```

You must install the service provider:

```
// config/app.php
'providers' => [
    ...
    NotificationChannels\Twilio\TwilioProvider::class,
],
```

### Setting up your Twilio account

[](#setting-up-your-twilio-account)

Add your Twilio Account SID, Auth Token, and From Number (optional) to your `config/services.php`:

```
// config/services.php
...
'twilio' => [
    'account_sid' => env('TWILIO_ACCOUNT_SID'),
    'auth_token' => env('TWILIO_AUTH_TOKEN'),
    'from' => env('TWILIO_FROM'), // optional
],
...
```

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the notification:

```
use NotificationChannels\Twilio\TwilioChannel;
use NotificationChannels\Twilio\TwilioSmsMessage;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [TwilioChannel::class];
    }

    public function toTwilio($notifiable)
    {
        return (new TwilioSmsMessage())
            ->content("Your {$notifiable->service} account was approved!");
    }
}
```

You can also create a Twilio call:

```
use NotificationChannels\Twilio\TwilioChannel;
use NotificationChannels\Twilio\TwilioCallMessage;
use Illuminate\Notifications\Notification;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [TwilioChannel::class];
    }

    public function toTwilio($notifiable)
    {
        return (new TwilioCallMessage())
            ->url("http://example.com/your-twiml-url");
    }
}
```

In order to let your Notification know which phone are you sending/calling to, the channel will look for the `phone_number` attribute of the Notifiable model. If you want to override this behaviour, add the `routeNotificationForTwilio` method to your Notifiable model.

```
public function routeNotificationForTwilio()
{
    return '+1234567890';
}
```

### Available Message methods

[](#available-message-methods)

#### TwilioSmsMessage

[](#twiliosmsmessage)

- `from('')`: Accepts a phone to use as the notification sender.
- `content('')`: Accepts a string value for the notification body.

#### TwilioCallMessage

[](#twiliocallmessage)

- `from('')`: Accepts a phone to use as the notification sender.
- `url('')`: Accepts an url for the call TwiML.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Gregorio Hernández Caso](https://github.com/gregoriohc)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~71 days

Total

10

Last Release

3116d ago

Major Versions

v0.0.2 → v1.0.02016-08-24

1.0.2 → 2.0.02017-03-07

PHP version history (2 changes)v0.0.1PHP &gt;=5.6.4

v1.0.1PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee030ea353e879f8e20fdfb1ef38d9bb05e7f9dc862acdc44aa20e83182665c2?d=identicon)[canerdogan](/maintainers/canerdogan)

---

Top Contributors

[![gregoriohc](https://avatars.githubusercontent.com/u/566841?v=4)](https://github.com/gregoriohc "gregoriohc (25 commits)")[![lnpbk](https://avatars.githubusercontent.com/u/608543?v=4)](https://github.com/lnpbk "lnpbk (14 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (9 commits)")[![mikemclin](https://avatars.githubusercontent.com/u/1570155?v=4)](https://github.com/mikemclin "mikemclin (5 commits)")[![canerdogan](https://avatars.githubusercontent.com/u/620056?v=4)](https://github.com/canerdogan "canerdogan (4 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (3 commits)")[![casperboone](https://avatars.githubusercontent.com/u/15815208?v=4)](https://github.com/casperboone "casperboone (2 commits)")[![REBELinBLUE](https://avatars.githubusercontent.com/u/2143908?v=4)](https://github.com/REBELinBLUE "REBELinBLUE (1 commits)")[![reinink](https://avatars.githubusercontent.com/u/882133?v=4)](https://github.com/reinink "reinink (1 commits)")[![themsaid](https://avatars.githubusercontent.com/u/4332182?v=4)](https://github.com/themsaid "themsaid (1 commits)")[![oyed](https://avatars.githubusercontent.com/u/172114265?v=4)](https://github.com/oyed "oyed (1 commits)")[![fwartner](https://avatars.githubusercontent.com/u/6692500?v=4)](https://github.com/fwartner "fwartner (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/canerdogan-twilio-notification-channel/health.svg)

```
[![Health](https://phpackages.com/badges/canerdogan-twilio-notification-channel/health.svg)](https://phpackages.com/packages/canerdogan-twilio-notification-channel)
```

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2588.1M15](/packages/laravel-notification-channels-twilio)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2022.1M6](/packages/laravel-notification-channels-apn)[laravel-notification-channels/pusher-push-notifications

Pusher native Push Notifications driver.

281770.7k1](/packages/laravel-notification-channels-pusher-push-notifications)[illuminate/notifications

The Illuminate Notifications package.

483.0M1.1k](/packages/illuminate-notifications)[spatie/laravel-backup-server

Backup multiple applications

17119.3k1](/packages/spatie-laravel-backup-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
