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

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

macellan/twilio
===============

Twilio SMS notification channel for Laravel

v2.0.0(1y ago)23.8kMITPHPPHP ^8.2CI passing

Since May 27Pushed 1y ago3 watchersCompare

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

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

Twilio SMS Notifications Channel for Laravel
============================================

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

[![Tests](https://github.com/macellan/twilio/actions/workflows/tests.yml/badge.svg)](https://github.com/macellan/twilio/actions/workflows/tests.yml/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/58725efe49eb5994456856fab9aa7003581f8d33479de8ac408dddbef322d984/68747470733a2f2f706f7365722e707567782e6f72672f6d6163656c6c616e2f7477696c696f2f762f737461626c65)](https://packagist.org/packages/macellan/twilio)[![Total Downloads](https://camo.githubusercontent.com/ec51a39f8a80493a9665bc511c2416575aad4367803bcaddab76767f8f640f79/68747470733a2f2f706f7365722e707567782e6f72672f6d6163656c6c616e2f7477696c696f2f646f776e6c6f616473)](https://packagist.org/packages/macellan/twilio)

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

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up the Twilio service](#setting-up-the-Twilio-service)
- [Usage](#usage)
    - [ On-Demand Notifications](#on-demand-notifications)
- [Testing](#testing)
- [Changelog](#changelog)
- [Credits](#credits)

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

[](#installation)

You can install this package via composer:

```
composer require macellan/twilio
```

### Setting up the Twilio service

[](#setting-up-the-twilio-service)

Add your Twilio configs to your config/services.php:

```
// config/services.php
...
    'sms' => [
        'twilio' => [
            'account_sid' => env('TWILIO_ACCOUNT_SID', ''),
            'auth_token' => env('TWILIO_AUTH_TOKEN', ''),
            'from' => env('TWILIO_FROM', ''),
            'enable' => env('TWILIO_ENABLE', false),
            'debug' => env('TWILIO_DEBUG', false), // Will log sending attempts and results
            'sandbox_mode' => env('TWILIO_SANDBOX_MODE', false), // Will not invoke API call
        ],
    ],
...
```

Usage
-----

[](#usage)

You can use the channel in your via() method inside the notification:

```
use Illuminate\Notifications\Notification;
use Macellan\Twilio\TwilioSmsMessage;

class TestNotification extends Notification
{
    public function via($notifiable): array
    {
        return ['twilio'];
    }

    public function toTwilio(object $notifiable): TwilioSmsMessage
    {
        return new TwilioSmsMessage('Twilio test message');
    }
}
```

In your notifiable model, make sure to include a routeNotificationForSms() method, which returns a phone number.

```
public function routeNotificationForSms(): string
{
    return $this->phone;
}
```

### On-Demand Notifications

[](#on-demand-notifications)

Sometimes you may need to send a notification to someone who is not stored as a "user" of your application. Using the Notification::route method, you may specify ad-hoc notification routing information before sending the notification:

```
Notification::route('sms', '+905554443322')
            ->notify(new TestNotification());
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

Credits
-------

[](#credits)

- [Arif Demir](https://github.com/epicentre)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance46

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

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

Total

3

Last Release

419d ago

Major Versions

v1.1.0 → v2.0.02025-03-25

PHP version history (2 changes)v1.0.0PHP ^8.0

v2.0.0PHP ^8.2

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/55ec06052d90f6008e382b949e1e7006daa38508300635fab5eac829f983bba2?d=identicon)[epicentre](/maintainers/epicentre)

---

Top Contributors

[![epicentre](https://avatars.githubusercontent.com/u/2106557?v=4)](https://github.com/epicentre "epicentre (5 commits)")[![faytekin](https://avatars.githubusercontent.com/u/4013224?v=4)](https://github.com/faytekin "faytekin (5 commits)")

---

Tags

laravelnotificationsmstwiliomacellan

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

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

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[gr8shivam/laravel-sms-api

A modern, flexible Laravel package for integrating any SMS gateway with REST API support

10138.4k](/packages/gr8shivam-laravel-sms-api)[ghanem/laravel-smsmisr

Send SMS and SMS Notification via SMS Misr for Laravel

194.8k](/packages/ghanem-laravel-smsmisr)

PHPackages © 2026

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