dgvai / laravel-notification-channel-isms
Laravel Notification Channel For iSMS SSLWireless Bangladesh
This package is auto-updated.
Last update: 2024-10-08 16:20:55 UTC
README
This package makes it easy to send sms via ISMS bulk SMS Service (Bangladesh) from SSL Wireless Company, with Laravel 5.5+, 6.x and 7.x.
Contents
Installation
You can install the package via composer:
composer require dgvai/laravel-notification-channel-isms
Setting up your configuration
Add your ISMS Account credentials to your config/services.php
:
// config/services.php ... 'isms' => [ 'token' => env('ISMS_TOKEN'), // The API-TOKEN generated from ISMS panel 'sid' => env('ISMS_SID'), // The SID of your stakeholder ], ...
In order to let your Notification know which phone are you sending to, the channel will look for the mobile_number
attribute of the Notifiable model (eg. User model). If you want to override this behaviour, add the routeNotificationForISMS
method to your Notifiable model.
public function routeNotificationForISMS() { return '+1234567890'; }
Usage
Now you can use the channel in your via()
method inside the notification:
use DGvai\ISMS\ISMS; use DGvai\ISMS\ISMSChannel; use Illuminate\Notifications\Notification; class OrderPlaced extends Notification { public function via($notifiable) { return [ISMSChannel::class]; } public function toISMS($notifiable) { return new ISMS('Your order has been placed!'); } }
Changelog
Please see CHANGELOG for more information what has changed recently.
License
The MIT License (MIT). Please see License File for more information.