PHPackages                             cca-bheath/laravel-sms-clicksend - 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. cca-bheath/laravel-sms-clicksend

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

cca-bheath/laravel-sms-clicksend
================================

ClickSend Notifications channel for Laravel 5.8+

4.0.1(5y ago)111.3k3MITPHPPHP &gt;=7.2

Since May 1Pushed 5y agoCompare

[ Source](https://github.com/cca-bheath/laravel-sms-clicksend)[ Packagist](https://packagist.org/packages/cca-bheath/laravel-sms-clicksend)[ Docs](https://github.com/cca-bheath/laravel-sms-clicksend)[ RSS](/packages/cca-bheath-laravel-sms-clicksend/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (9)Versions (13)Used By (0)

ClickSend notifications channel for Laravel 5.8 / 6.\* / 7.\* / 8.\*
====================================================================

[](#clicksend-notifications-channel-for-laravel-58--6--7--8)

This package makes it easy to send notifications using [clicksend.com](//clicksend.com) with Laravel 5.6+. Uses ClickSend PHP API wrapper \[\]

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Events](#events)
- [Api Client](#api-client)
- [Changelog](#changelog)
- [Testing](#testing)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

Install the package via composer:

```
composer require cca-bheath/laravel-sms-clicksend
```

Add the service provider to `config/app.php`:

```
...
'providers' => [
    ...
    NotificationChannels\ClickSend\ClickSendServiceProvider::class,
],
...
```

Publish the clicksend config file `config/clicksend.php`:

```
php artisan vendor:publish --provider="NotificationChannels\ClickSend\ClickSendServiceProvider" --tag="config"
```

Usage
-----

[](#usage)

Use ClickSendChannel in `via()` method inside your notification classes. Example:

```
namespace App\Notifications;

use Illuminate\Notifications\Notification;
use NotificationChannels\ClickSend\ClickSendMessage;
use NotificationChannels\ClickSend\ClickSendChannel;

class ClickSendTest extends Notification
{

    public $token;

    /**
     * Create a notification instance.
     *
     * @param string $token
     */
    public function __construct($token)
    {
        $this->token = $token;
    }

    /**
     * Required
     */
    public function via($notifiable)
    {
        return [ClickSendChannel::class];
    }

    /**
     * Required
     */
    public function getMessage($notifiable)
    {
       	return "SMS test to user #{$notifiable->id} with token {$this->token} by ClickSend";
    }

    /**
     * Optional
     */
    public function updateClickSendMessage($message)
    {
        $message->setFrom('+15555555555');

        return $message;
    }
}
```

In notifiable model (User), include method `routeNotificationForClickSend()` that returns recipient mobile number:

```
...
public function routeNotificationForClickSend()
{
    return $this->phone;
}
...
```

### Optional

[](#optional)

If you want to use a custom notification route instead:

```
Notification::route('notification_for_click_send', '+15555555555')
              ->notify(new ClickSendTest());
```

From controller then send notification standard way:

```
$user = User::find(1);

try {
	$user->notify(new ClickSendTest('ABC123'));
}
catch (\Exception $e) {
	// do something when error
	return $e->getMessage();
}
```

Events
------

[](#events)

Following events are triggered by Notification. By default:

- Illuminate\\Notifications\\Events\\NotificationSending
- Illuminate\\Notifications\\Events\\NotificationSent

and this channel triggers one when submission fails for any reason:

- Illuminate\\Notifications\\Events\\NotificationFailed

To listen to those events create listener classes in `app/Listeners` folder e.g. to log failed SMS:

```
namespace App\Listeners;

use Illuminate\Notifications\Events\NotificationFailed;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Log;
use NotificationChannels\ClickSend\ClickSendChannel;

class NotificationFailedListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Notification failed event handler
     *
     * @param  NotificationFailed  $event
     * @return void
     */
    public function handle(NotificationFailed $event)
    {
        // Handle fail event for ClickSend
        //
        if($event->channel == ClickSendChannel::class) {

            echo 'failed'; dump($event);

            $logData = [
            	'notifiable'    => $event->notifiable->id,
            	'notification'  => get_class($event->notification),
            	'channel'       => $event->channel,
            	'data'      => $event->data
            	];

            Log::error('Notification Failed', $logData);
         }
         // ... handle other channels ...
    }
}
```

Then register listeners in `app/Providers/EventServiceProvider.php`

```
...
protected $listen = [

	'Illuminate\Notifications\Events\NotificationFailed' => [
		'App\Listeners\NotificationFailedListener',
	],

	'Illuminate\Notifications\Events\NotificationSent' => [
		'App\Listeners\NotificationSentListener',
	],

	'Illuminate\Notifications\Events\NotificationSending' => [
		'App\Listeners\NotificationSendingListener',
	],
];
...
```

API Client
----------

[](#api-client)

To access the rest of ClickSend API you can get client from ClickSendApi:

```
$client = app(ClickSendApi::class)->getClient();

// then get for eaxample yor ClickSend account details:
$account =  $client->getAccount()->getAccount();

// or list of countries:
$countries =  $client->getCountries()->getCountries();
```

Config
------

[](#config)

- `CLICKSEND_DRIVER`
    - `clicksend` or `log`
    - Setting to `log` will send the SMS message to the log file and **not** try to send it
- `CLICKSEND_ENABLED`
    - If set to false the channel will not run and return true. This is good for testing
- `CLICKSEND_USERNAME`
    - Username on ClickSend
    - You can see this information by click on the API Credentials link at the top of the dashboard
- `CLICKSEND_API_KEY`
    - API Key on ClickSend
    - You can see this information by click on the API Credentials link at the top of the dashboard
- `CLICKSEND_SMS_FROM`
    - Override the FROM on SMS and MMS messages
    - Can leave blank
- `CLICKSEND_PREFIX`
    - Enforce that all `to` have this prefix
    - For example +1
    - This should only be used if you are sure that ***all*** `to` ***must*** have this prefix

Changelog
---------

[](#changelog)

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

Testing
-------

[](#testing)

Incomplete

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [deshack](https://github.com/deshack)
- [vladski](https://github.com/vladski)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 60.7% 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 ~128 days

Total

12

Last Release

1942d ago

Major Versions

1.1.0 → 2.0.02019-09-16

2.1.1 → 3.0.02020-06-03

3.0.0 → 4.0.02020-11-19

PHP version history (3 changes)v1.0.1PHP &gt;=5.6.4

1.1.0-beta1PHP &gt;=7.1

2.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/35047806?v=4)[Bryan Heath](/maintainers/cca-bheath)[@cca-bheath](https://github.com/cca-bheath)

---

Top Contributors

[![cca-bheath](https://avatars.githubusercontent.com/u/35047806?v=4)](https://github.com/cca-bheath "cca-bheath (17 commits)")[![vladski](https://avatars.githubusercontent.com/u/463686?v=4)](https://github.com/vladski "vladski (6 commits)")[![deshack](https://avatars.githubusercontent.com/u/2034213?v=4)](https://github.com/deshack "deshack (5 commits)")

---

Tags

laravelnotificationssmsClickSend

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/cca-bheath-laravel-sms-clicksend/health.svg)

```
[![Health](https://phpackages.com/badges/cca-bheath-laravel-sms-clicksend/health.svg)](https://phpackages.com/packages/cca-bheath-laravel-sms-clicksend)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M131](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

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

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2588.4M17](/packages/laravel-notification-channels-twilio)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[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)
