Package Data | |
---|---|
Maintainer Username: | omarusman |
Maintainer Contact: | omar@clicksend.com (Omar Usman) |
Package Create Date: | 2016-11-18 |
Package Last Update: | 2016-11-19 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-04-23 03:14:44 |
Package Statistics | |
---|---|
Total Downloads: | 27 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 2 |
Total Open Issues: | 0 |
This package makes it easy to send notifications using ClickSend with Laravel 5.3.
You can install the package via composer:
composer require laravel-notification-channels/clicksend
You must install the service provider:
// config/app.php
'providers' => [
...
NotificationChannels\ClickSend\ClicksendProvider::class,
],
Add your ClickSend Username and API Key to your config/services.php
:
// config/services.php
...
'clicksend' => [
'username' => env('CLICKSEND_USERNAME'),
'api_key' => env('CLICKSEND_API_KEY'),
'base_uri' => env('CLICKSEND_BASE_URI'), // optional
],
...
Now you can use the channel in your via()
method inside the notification:
use NotificationChannels\ClickSend\ClicksendChannel;
use NotificationChannels\ClickSend\ClicksendSmsMessage;
use Illuminate\Notifications\Notification;
class OrderPaid extends Notification
{
public function via($notifiable)
{
return [ClicksendChannel::class];
}
public function toClicksend($notifiable)
{
return (new ClicksendSmsMessage())
->content("Thank you! You successfully paid for your Order #123");
}
}
In order to let your Notification know which phone are you sending to, the channel will look for the sms
attribute of the Notifiable model. If you want to override this behaviour, add the routeNotificationForClicksend
method to your Notifiable model.
public function routeNotificationForClicksend()
{
return '+1234567890';
}
content('')
: Accepts a string value for the notification body.Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email omar@clicksend.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.