PHPackages                             superloop-ltd/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. superloop-ltd/laravel-sms-clicksend

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

superloop-ltd/laravel-sms-clicksend
===================================

ClickSend Notifications channel for Laravel 5.1+

4.0.0(5y ago)110.8kMITPHPPHP ^7.3

Since Nov 6Pushed 5y agoCompare

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

READMEChangelog (5)Dependencies (6)Versions (13)Used By (0)

ClickSend notifications channel for Laravel 5.1+
================================================

[](#clicksend-notifications-channel-for-laravel-51)

This package makes it easy to send notifications using [clicksend.com](//clicksend.com) with Laravel 5.1+. 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 superloop-ltd/laravel-sms-clicksend
```

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

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

Add your ClickSend username, api\_key and optional default sender sms\_from to your `config/services.php`:

```
...
'clicksend' => [
	'username' => env('CLICKSEND_USERNAME'),
	'api_key'  => env('CLICKSEND_API_KEY'),
],
...
```

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;
    }

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

    public function toClickSend($notifiable)
    {
        // statically create message object:

        $message = ClickSendMessage::create("SMS test to user #{$notifiable->id} with token {$this->token} by ClickSend");

        // OR instantiate:

        $message = new ClickSendMessage("SMS test to user #{$notifiable->id} with token {$this->token} by ClickSend");

       	// available methods:

       	$message->content("SMS test to user #{$notifiable->id} with token {$this->token} by ClickSend");
       	$message->from('+6112345678');
        $message->custom('123e4567-e89b-12d3-a456-426655440000'); // this can be useful for tracking message responses

       	return $message;
    }
}
```

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

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

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();
```

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)

- [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

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~72 days

Total

12

Last Release

2072d ago

Major Versions

1.5 → 2.02019-11-25

2.1.1 → 3.02020-03-11

3.0 → 4.0.02020-09-08

PHP version history (2 changes)v1.1PHP &gt;=5.6.4

4.0.0PHP ^7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/44064852e6895bec4fa6330fd0d6d2b3a1b2d8b3466f12ef717a2bf94c8fdfe0?d=identicon)[parkourben99](/maintainers/parkourben99)

---

Top Contributors

[![parkourben99](https://avatars.githubusercontent.com/u/7295774?v=4)](https://github.com/parkourben99 "parkourben99 (6 commits)")[![vladski](https://avatars.githubusercontent.com/u/463686?v=4)](https://github.com/vladski "vladski (6 commits)")[![michaeldyrynda](https://avatars.githubusercontent.com/u/558441?v=4)](https://github.com/michaeldyrynda "michaeldyrynda (5 commits)")

---

Tags

laravelnotificationssmsClickSend

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

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

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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