PHPackages                             carropublic/notifications - 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. carropublic/notifications

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

carropublic/notifications
=========================

A collections of notification channels and senders

1.4.3(3mo ago)043.6k↓73.5%MITPHP

Since Mar 11Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/carro-public/notifications)[ Packagist](https://packagist.org/packages/carropublic/notifications)[ RSS](/packages/carropublic-notifications/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (12)Versions (34)Used By (0)

Notifications
=============

[](#notifications)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f1ab711b8ac992fec0c79fb6a16ef57822c430bc5814cca89f72e0f53a20a985/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636172726f7075626c69632f6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/carropublic/notifications)[![Total Downloads](https://camo.githubusercontent.com/67030ab460aa78b5b4b03eaf838ec9e1488fa1152255d40d909d758f002aad68/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636172726f7075626c69632f6e6f74696669636174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/carropublic/notifications)

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

[](#installation)

Via Composer

```
$ composer require carropublic/notifications
```

Run the following vendor publish to publish Twillo config.

```
php artisan vendor:publish --provider="CarroPublic\Notifications\NotificationServiceProvider"
```

Usage
-----

[](#usage)

### LaravelNotification

[](#laravelnotification)

The following is the example usage of the package with Laravel's Notification.

#### Create Notification Class

[](#create-notification-class)

```
class ExampleNotification extends Notification
{
    // Which channel this notification should be sent to
    public function via($notifiable)
    {
        return [ SMSChannel::class, WhatsAppChannel::class ];
    }

    // Notification payload (content) will be sent
    public function toSMS($notifiable)
    {
        return new LaravelTwilioMessage("Message Content");
    }

    // Notification payload (content) will be sent
    public function toWhatsApp($notifiable)
    {
        return new LaravelTwilioMessage("Message Content");
    }
}

```

#### Create Notifiable Class

[](#create-notifiable-class)

```
class Contact extends Model {

    use Notifiable;

    // Phone number to receive
    public function routeNotificationForSms()
    {
        return $this->phone;
    }

    // Phone number to receive
    public function routeNotificationForWhatsapp()
    {
        return $this->phone;
    }
}

```

##### Sending Notification from Notifiable Instance

[](#sending-notification-from-notifiable-instance)

```
$contact->notify(new ExampleNotification());

```

##### Sending Notification from Anonymous Notifiable Instance

[](#sending-notification-from-anonymous-notifiable-instance)

```
Notification::route('sms')->notify(new ExampleNotification());

```

Sandbox Mode
------------

[](#sandbox-mode)

#### How to enable SandBox Mode

[](#how-to-enable-sandbox-mode)

1. Register Closure to return if testing is enabled `\CarroPublic\Notifications\Senders\Sender::registerSandboxValidator`

Example:

```
Sender::registerSandboxValidator(function () {
    return !is_production();
});

```

2. Otherwise, use`NOTIFICATION_SANDBOX_ENABLE` to determine if running in sandbox mode. Default `false`

**⛔️ Notes: If the closure is registered, the env will be ignored**

#### How to bypass sandbox validator

[](#how-to-bypass-sandbox-validator)

- Register Closure to return if sandbox is enabled `\CarroPublic\Notifications\Senders\Sender::registerValidForSandbox`

$to: the recipient the message will be sent to $type: the sender class

- LineSender
- TelerivetSender
- TwilioSender
- MailChannel (Since there is not MailSender, the MailChannel will be used instead)

```
LaravelTwilioSender::registerValidPhoneForSandbox(function ($to, $type) {
    switch ($type) {
        case LineSender::class:
            return true;
        case TwilioSender::class:
            return false;
    }
}

```

Change log
----------

[](#change-log)

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

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Carro](https://github.com/carro-public)
- [All Contributors](../../contributors%5D)

License
-------

[](#license)

Please see the [license file](license.md) for more information.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance81

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 88.6% 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 ~59 days

Recently: every ~72 days

Total

26

Last Release

100d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5352704?v=4)[Si Thu Aung](/maintainers/sithuaung)[@sithuaung](https://github.com/sithuaung)

![](https://www.gravatar.com/avatar/157df3dda57b84fda6cf5c2da53974dc7eb9299ce8e27fffb6b0b88112358491?d=identicon)[setkyar](/maintainers/setkyar)

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

![](https://avatars.githubusercontent.com/u/169651273?v=4)[carro-tech](/maintainers/carro-tech)[@carro-tech](https://github.com/carro-tech)

![](https://www.gravatar.com/avatar/f2a97fcbee13f9514081883ddbd05ea295dfe71f62fa4b78421ad1a9f4e2d90f?d=identicon)[datpm.carro](/maintainers/datpm.carro)

---

Top Contributors

[![datpmwork](https://avatars.githubusercontent.com/u/9279315?v=4)](https://github.com/datpmwork "datpmwork (70 commits)")[![carroaung](https://avatars.githubusercontent.com/u/92419131?v=4)](https://github.com/carroaung "carroaung (5 commits)")[![thangnq95](https://avatars.githubusercontent.com/u/29391396?v=4)](https://github.com/thangnq95 "thangnq95 (3 commits)")[![NaingAungLu](https://avatars.githubusercontent.com/u/24864729?v=4)](https://github.com/NaingAungLu "NaingAungLu (1 commits)")

---

Tags

laravelnotifications

### Embed Badge

![Health badge](/badges/carropublic-notifications/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[illuminate/view

The Illuminate View package.

13047.0M2.2k](/packages/illuminate-view)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2588.4M17](/packages/laravel-notification-channels-twilio)[laravel-notification-channels/pusher-push-notifications

Pusher native Push Notifications driver.

281788.6k1](/packages/laravel-notification-channels-pusher-push-notifications)

PHPackages © 2026

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