PHPackages                             hachetaustralia/smsbroadcast - 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. hachetaustralia/smsbroadcast

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

hachetaustralia/smsbroadcast
============================

SMS Broadcast notification channel for Laravel 8

v3.0(5y ago)28.9k2[1 issues](https://github.com/hatchetaustralia/smsbroadcast/issues)MITPHPPHP ^7.4|^8.0

Since Aug 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/hatchetaustralia/smsbroadcast)[ Packagist](https://packagist.org/packages/hachetaustralia/smsbroadcast)[ Docs](https://github.com/hatchetaustralia/smsbroadcast)[ RSS](/packages/hachetaustralia-smsbroadcast/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (10)Versions (9)Used By (0)

SMS Broadcast notifications channel for Laravel 8
=================================================

[](#sms-broadcast-notifications-channel-for-laravel-8)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a619e5b4fe296d65989c68e8c24251a79cdc9e43f0f8c5588fe030dbfcea732e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6861636865746175737472616c69612f736d7362726f6164636173742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hachetaustralia/smsbroadcast)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/cea16ccb35bc9dac98327a08d8d5966aed3640b17d0c91d10dfe188a0ad9e894/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6861636865746175737472616c69612f736d7362726f6164636173742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hachetaustralia/smsbroadcast)

This package makes it easy to send SMS Broadcast SMS notifications with Laravel 8

Contents
--------

[](#contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Setting up your SMSBroadcast account](#setting-up-your-smsbroadcast-account)
- [Using a custom logging channel](#using-a-custom-logging-channel)
- [Usage](#usage)
    - [Available methods](#available-methods)
    - [Available events](#available-events)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

Requirements
------------

[](#requirements)

- [Sign up](https://www.smsbroadcast.com.au/join) for a free SMS Broadcast account

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

[](#installation)

You can install the package via composer:

```
composer require hachetaustralia/smsbroadcast
```

for Laravel 6 and 7, please use the 2.x version of this package. for Laravel 5.8 or lower, please use the 1.x version of this package.

Setting up your SMSBroadcast account
------------------------------------

[](#setting-up-your-smsbroadcast-account)

Add the environment variables to your `config/services.php`:

```
// config/services.php
...
'smsbroadcast' => [
    'username' => env('SMSBROADCAST_USERNAME'),
    'password' => env('SMSBROADCAST_PASSWORD'),
    'from' => env('SMSBROADCAST_FROM'),
    'sandbox' => env('SMSBROADCAST_SANDBOX'),
],
...
```

Add your SMS Broadcast username and password as well as the default from number/alphanumeric code to your `.env`:

```
// .env
...
SMSBROADCAST_USERNAME=
SMSBROADCAST_PASSWORD=
SMSBROADCAST_FROM=
SMSBROADCAST_SANDBOX=false
],
...
```

Notice: The from can contain a maximum of 11 alphanumeric characters. You can also specify sandbox to true for testing (no post requests are made).

Setup your route on your `notifiable` model such as your User with the default destination for that model (single number or array of numbers).

```
namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    public function routeNotificationForSmsBroadcast()
    {
        return $this->mobile;
    }
}
```

```
namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    public function routeNotificationForSmsBroadcast()
    {
        return [ $this->mobile_primary, $this->mobile_secondary ];
    }
}
```

Using a Custom Logging Channel
------------------------------

[](#using-a-custom-logging-channel)

Debug logs will automatically use your default logging channel, however you can specify a custom logging channel by adding the following to your `config/services.php` file:

```
// config/services.php
...
'smsbroadcast' => [
    'logging_channel' => env('SMSBROADCAST_LOGGING_CHANNEL'),
]
...
```

And the following to your `.env` file

```
// .env
...
SMSBROADCAST_LOGGING_CHANNEL=
...
```

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the notification:

```
use NotificationChannels\SMSBroadcast\SMSBroadcastChannel;
use NotificationChannels\SMSBroadcast\SMSBroadcastMessage;
use Illuminate\Notifications\Notification;

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

    public function toSMSBroadcast($notifiable)
    {
        return (new SMSBroadcastMessage("Your {$notifiable->service} was ordered!"));
    }
}
```

### Available methods

[](#available-methods)

Additionally you can add or change recipients (single value or array)

```
return (new SMSBroadcastMessage("Your {$notifiable->service} was ordered!"))->setRecipients($recipients);
```

In order to handle a status report you can also set a reference

```
return (new SMSBroadcastMessage("Your {$notifiable->service} was ordered!"))->setReference($id);
```

Maximum message splits are supported as well to determine the maximum number of SMS message credits to use per recipient. This defaults to 1.

```
return (new SMSBroadcastMessage("Your {$notifiable->service} was ordered!"))->setMaxSplit(2);
```

You can also delay message sending by a specified number of minutes

```
return (new SMSBroadcastMessage("Your {$notifiable->service} is ready to go!"))->setDelay(10);
```

Setting a private reference will not transmit to SMS Broadcast and be available should you need it on the `MessageWasSent` event as a property of the `SMSBroadcastMessage`. This is useful if you want to set something like a foreign key that you can utilise on a listener listening to the `MessageWasSent` event.

```
return (new SMSBroadcastMessage("Your {$notifiable->service} is ready to go!"))->setPrivateReference(12345);
```

If you wish to use SMS Broadcast's default two-way SMS number as the from number, simply `setNoFrom()` on the message instance

```
return (new SMSBroadcastMessage("Your {$notifiable->service} is ready to go!"))->setNoFrom();
```

### Available events

[](#available-events)

SMS Broadcast Notification channel comes with handy events which provides the required information about the SMS messages.

1. **Message Was Sent** (`NotificationChannels\SMSBroadcast\Events\MessageWasSent`)

Example:

```
namespace App\Listeners;

use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use NotificationChannels\SMSBroadcast\Events\MessageWasSent;

class SentMessageHandler
{
    /**
     * Handle the event.
     *
     * @param  MessageWasSent  $event
     * @return void
     */
    public function handle(MessageWasSent $event)
    {
        $response = $event->response;
        $message = $event->message;
    }
}
```

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)

- [Hatchet](https://hatchet.com.au)
- [glennforrest](https://github.com/glennforrest/)

License
-------

[](#license)

The `NoHarm` Licence. Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity72

Established project with proven stability

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

Recently: every ~229 days

Total

8

Last Release

1918d ago

Major Versions

v1.0.4 → v2.02019-11-25

v2.0.1 → v3.02021-02-16

PHP version history (3 changes)v1.0PHP &gt;=7.0.0

v2.0PHP ^7.2

v3.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a3485b619f8f287aba5325e29d894b0d43b16cc9d413816a39c0b4dc2aa8dd8?d=identicon)[hatchet](/maintainers/hatchet)

---

Top Contributors

[![glennforrest](https://avatars.githubusercontent.com/u/12944411?v=4)](https://github.com/glennforrest "glennforrest (1 commits)")[![hatchetaustralia](https://avatars.githubusercontent.com/u/14148655?v=4)](https://github.com/hatchetaustralia "hatchetaustralia (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hachetaustralia-smsbroadcast/health.svg)

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[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)[laravel-notification-channels/fcm

FCM (Firebase Cloud Messaging) Notifications Driver for Laravel

5917.0M16](/packages/laravel-notification-channels-fcm)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)

PHPackages © 2026

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