2017 © Pedro Peláez
 

library clickatell

Clickatell notifications driver

image

laravel-notification-channels/clickatell

Clickatell notifications driver

  • Tuesday, February 27, 2018
  • by laravel-notification-channels
  • Repository
  • 2 Watchers
  • 3 Stars
  • 74 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

Clickatell notifications channel for Laravel

Latest Version on Packagist Software License Build Status StyleCI SensioLabsInsight Quality Score Code Coverage Total Downloads, (*1)

This package makes it easy to send notifications using clickatell.com with Laravel 5.5+, 6.x, 7.x & 8.x., (*2)

Contents

Installation

You can install the package via composer:, (*3)

composer require laravel-notification-channels/clickatell

Setting up the clickatell service

Add your Clickatell user, password and api identifier to your config/services.php:, (*4)

// config/services.php
...
'clickatell' => [
    'user'  => env('CLICKATELL_USER'),
    'pass' => env('CLICKATELL_PASS'),
    'api_id' => env('CLICKATELL_API_ID'),
],
...

Usage

To route Clickatell notifications to the proper phone number, define a routeNotificationForClickatell method on your notifiable entity:, (*5)

class User extends Authenticatable
{
    use Notifiable;

    /**
     * Route notifications for the Nexmo channel.
     *
     * @param  \Illuminate\Notifications\Notification  $notification
     * @return string
     */
    public function routeNotificationForClickatell($notification)
    {
        return $this->phone_number; 
    }
}

You can use the channel in your via() method inside the notification:, (*6)

use Illuminate\Notifications\Notification;
use NotificationChannels\Clickatell\ClickatellMessage;
use NotificationChannels\Clickatell\ClickatellChannel;

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

    public function toClickatell($notifiable)
    {
        return (new ClickatellMessage())
            ->content("Your {$notifiable->service} account was approved!");
    }
}

Available methods

TODO, (*7)

Changelog

Please see CHANGELOG for more information what has changed recently., (*8)

Testing

bash $ composer test, (*9)

Security

If you discover any security related issues, please email hello@etiennemarais.co.za instead of using the issue tracker., (*10)

Contributing

Please see CONTRIBUTING for details., (*11)

Credits

License

The MIT License (MIT). Please see License File for more information., (*12)

The Versions

27/02 2018
26/08 2016
15/08 2016