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

ActiveLibrary

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

A collections of notification channels and senders

1.4.2(5mo ago)041.2k↓39.1%MITPHP

Since Mar 11Pushed 1mo ago4 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (32)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 95% 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 ~57 days

Recently: every ~47 days

Total

25

Last Release

162d ago

### Community

Maintainers

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

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

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

![](https://www.gravatar.com/avatar/170e8e0e4b2ce9b2768af2b02ab22cb615ed0f591f18061c8ab3686c49596936?d=identicon)[carro-tech](/maintainers/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

[laravel/slack-notification-channel

Slack Notification Channel for laravel.

89169.7M111](/packages/laravel-slack-notification-channel)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[laravel-notification-channels/pusher-push-notifications

Pusher native Push Notifications driver.

282733.2k1](/packages/laravel-notification-channels-pusher-push-notifications)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[laravel-notification-channels/plivo

Plivo SMS notifications driver for Laravel

1015.9k](/packages/laravel-notification-channels-plivo)

PHPackages © 2026

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