PHPackages                             laravelnotificationchannels/twilio - 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. laravelnotificationchannels/twilio

ActiveLibrary

laravelnotificationchannels/twilio
==================================

A boilerplate for contributions.

2.0.6(8y ago)07MITPHPPHP &gt;=5.5.9

Since Aug 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/muzafarali/twilio)[ Packagist](https://packagist.org/packages/laravelnotificationchannels/twilio)[ Docs](https://github.com/laravel-notification-channels/twilio)[ RSS](/packages/laravelnotificationchannels-twilio/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (7)Versions (15)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
```

Add the service provider (only required on Laravel 5.4 or lower):

```
// 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' => [
    'username' => env('TWILIO_USERNAME'), // optional when using auth token
    'password' => env('TWILIO_PASSWORD'), // optional when using auth token
    'auth_token' => env('TWILIO_AUTH_TOKEN'), // optional when using username and password
    'account_sid' => env('TWILIO_ACCOUNT_SID'),
    '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 send an MMS:

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

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

    public function toTwilio($notifiable)
    {
        return (new TwilioMmsMessage())
            ->content("Your {$notifiable->service} account was approved!")
            ->mediaUrl("https://picsum.photos/300");
    }
}
```

Or 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 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

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 ~53 days

Recently: every ~0 days

Total

12

Last Release

2978d 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/370016c4d115b33248f2ff1acf46da3ae83a32b59528ea6fed0cd3e4a5b1785e?d=identicon)[muzafarali](/maintainers/muzafarali)

---

Top Contributors

[![gregoriohc](https://avatars.githubusercontent.com/u/566841?v=4)](https://github.com/gregoriohc "gregoriohc (37 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)")[![muzafarali](https://avatars.githubusercontent.com/u/3097459?v=4)](https://github.com/muzafarali "muzafarali (4 commits)")[![fwartner](https://avatars.githubusercontent.com/u/6692500?v=4)](https://github.com/fwartner "fwartner (3 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)")[![cmgmyr](https://avatars.githubusercontent.com/u/4693481?v=4)](https://github.com/cmgmyr "cmgmyr (1 commits)")[![oyed](https://avatars.githubusercontent.com/u/172114265?v=4)](https://github.com/oyed "oyed (1 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)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laravelnotificationchannels-twilio/health.svg)

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

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[laravel-notification-channels/pusher-push-notifications

Pusher native Push Notifications driver.

282733.2k1](/packages/laravel-notification-channels-pusher-push-notifications)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[sassnowski/venture

A package to manage complex workflows built on top of Laravel's queue.

825254.5k1](/packages/sassnowski-venture)

PHPackages © 2026

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