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

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

boyo/laravel-twilio
===================

Laravel notifications with Twilio

v1.2(3y ago)01.7kMITPHPPHP &gt;=7.2

Since Oct 13Pushed 3y ago1 watchersCompare

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

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

Twilio Notification channel
===========================

[](#twilio-notification-channel)

This package adds a notification channel for Twilio services. You can use it to send SMS messages. Other channels might be available in the future.

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

[](#installation)

Install through Composer.

Config
------

[](#config)

Add the following to your services config file.

```
'twilio' => [
	'token' => env('TWILIO_TOKEN',''),
	'sid' => env('TWILIO_SID',''),
	'send' => env('TWILIO_SEND',false),
	'from' => env('TWILIO_FROM',''),
	'log' => env('TWILIO_LOG',true),
	'log_channel' => env('TWILIO_LOG_CHANNEL','stack'),
	'prefix' => '',
	'allow_multiple' => false,
],
```

- *log* if the messages should be written to a log file
- *log\_channel* the log channel to log messages to
- *send* if the messages should be sent (production/dev environment)
- *bulglish* if cyrillic text should be converted to latin letters for SMS messages (cyrillic messages are limited to 67 characters)
- *allow\_multiple* if SMS messages above 160 characters should be allowed (billed as multiple messages)

Send test
---------

[](#send-test)

To send a test message use the following artisan command:

`php artisan twilio:test phone --message='content' --channel=sms`

Direct usage
------------

[](#direct-usage)

You can instantiate a `Boyo\Twilio\TwilioMessage` object and send it immediately.

```
use Boyo\Twilio\TwilioMessage;
use Boyo\Twilio\TwilioSender;

class MyClass
{
	public function myFunction()
	{
		$message = (new TwilioMessage())->to('359888888888')->sms('SMS text');

		$client = new TwilioSender();
		$client->send($message);
	}
}
```

Usage with notifications
------------------------

[](#usage-with-notifications)

1. Create a message file that extends `Boyo\Twilio\TwilioMessage`. It can take whatever data you need in the construct and should implement a `build()` method that defines the messages text content - a good practice would be to render a view file, so that your message content is in your views. You should only define the methods for the delivery channels that your are going to use.

```
use Boyo\Twilio\TwilioMessage;

class MyMessage extends TwilioMessage
{
	public function __construct($data)
    {
        $this->id = $data->id; // your unique message id, add other parameters if needed
    }

	public function build() {
		// set your sms text
		$this->sms('SMS text');

		return $this;
	}
}
```

2. In your Notification class you can now include the Twilio channel in the `$via` array returned by the `via()` method.

```
use Boyo\Twilio\TwilioChannel;

via($notifiable)
{

	// ...

	$via[] = TwilioChannel::class;

	return $via

}
```

Within the same Notification class you should also define a method `toSms()`:

```
public function toSms($notifiable)
{
	return (new MyMessage($unique_id))->to($notifiable->phone);
}
```

The channel method is where you define the delivery channel you wish to use.

- **sms** delivery by sms only (this is the default value, if you omit the channel method)
- other Twilio channels might be available in the future

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

1313d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15925335?v=4)[Boyan Raichev](/maintainers/boyanraichev)[@boyanraichev](https://github.com/boyanraichev)

---

Top Contributors

[![boyanraichev](https://avatars.githubusercontent.com/u/15925335?v=4)](https://github.com/boyanraichev "boyanraichev (4 commits)")

---

Tags

laravelnotificationssmstwilio

### Embed Badge

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

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

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

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

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

320244.3k6](/packages/tzsk-sms)[simplesoftwareio/simple-sms

Simple-SMS is a package made for Laravel to send/receive (polling/pushing) text messages. Currently supports CalLFire, EZTexting, Email Gateways, FlowRoute, LabsMobile, Mozeo, Nexmo, Plivo, Twilio, and Zenvia

20845.7k5](/packages/simplesoftwareio-simple-sms)

PHPackages © 2026

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