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

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

jordanhavard/laravel-sms-clicksend
==================================

ClickSend Notifications channel for Laravel 9

2.3(2y ago)01.7k1MITPHPPHP ^8.0

Since Mar 7Pushed 2y ago1 watchersCompare

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

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

ClickSend notifications channel for Laravel 9.x
===============================================

[](#clicksend-notifications-channel-for-laravel-9x)

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

The package will be auto discovered.

Publish the `config/clicksend.php` configuration file using the command below

```
php artisan vendor:publish --provider="JordanHavard\ClickSend\ClickSendServiceProvider"
```

Usage
-----

[](#usage)

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

```
namespace App\Notifications;

use Illuminate\Notifications\Notification;
use JordanHavard\ClickSend\ClickSendMessage;
use JordanHavard\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 (Not yet implemented)
----------------------------

[](#events-not-yet-implemented)

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 JordanHavard\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 (not yet implemented)
--------------------------------

[](#api-client-not-yet-implemented)

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

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor3

3 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 ~34 days

Recently: every ~13 days

Total

8

Last Release

972d ago

Major Versions

1.1.0 → 2.02023-04-20

PHP version history (2 changes)1.0.0PHP ^7.3|^8.1

2.0PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![davebelle85](https://avatars.githubusercontent.com/u/126028363?v=4)](https://github.com/davebelle85 "davebelle85 (6 commits)")[![jordanhavard](https://avatars.githubusercontent.com/u/67948773?v=4)](https://github.com/jordanhavard "jordanhavard (6 commits)")[![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

Code StyleLaravel Pint

### Embed Badge

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

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

PHPackages © 2026

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