Download the PHP package craftsys/msg91-laravel-notification-channel without Composer
On this page you can find all versions of the php package craftsys/msg91-laravel-notification-channel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download craftsys/msg91-laravel-notification-channel
More information about craftsys/msg91-laravel-notification-channel
Files in craftsys/msg91-laravel-notification-channel
Package msg91-laravel-notification-channel
Short Description Laravel notification channel for MSG91 apis.
License MIT
Homepage https://github.com/craftsys/msg91-laravel-notification-channel
Informations about the package msg91-laravel-notification-channel
Laravel Notification Channels For Msg91 SMS Notifications
Laravel notification channel for Msg91 API (wrapper around Laravel Msg91 Client)
Table of Contents
- Installation
- Configuration
- Usage
- SMS
- OTP
- Verify OTP
- Routing SMS Notifications
- Advanced Usage
- Related
- Acknowledgements
Installation
prerequisite
- php^7.1
- laravel^5|^6|^7|^8|^9|^10
The package is tested for 5.8+,^6.0,^7.0,^8.0,^9.0,^10.0 only. If you find any bugs for laravel (5.0< >5.8), please file an issue.
If you just want to integrate Msg91 api in Laravel without notification channel, please use Msg91 Laravel instead.
Configuration
Next, you will need to add a few configuration options to your config/services.php
configuration file. You may copy the example configuration below to get started:
All available configuration can be found at msg91-php client's configuration page
Usage
If a notification supports being sent as an SMS, you should define a toMsg91
method on the notification class. This method will receive a $notifiable
entity and should return a Craftsys\Notifications\Messages\Msg91SMS
or Craftsys\Notifications\Messages\Msg91OTP
instance based on your need to sending message or sending an OTP.
NOTE: Phone number must be in international format i.e. it must include the country code.
SMS
OTP
Verify OTP
This package include the Laravel Msg91 Client, so you can use all the api provided by that package like verify an OTP, sending otp without using notification channel etc.
You can access the client using Msg91
facade as follows:
Routing SMS Notification
When sending notifications via the msg91
channel, the notification system will automatically look for a
phone_number
attribute on the notifiable entity. If you would like to customize the phone number the notification
is delivered to, define a routeNotificationForMsg91
method on the entity as suggested on laravel
docs.
You can also set the recipient(s) when composing your message in the toMsg91
method of your notification as
follows:
Advanced Usage
These messages Msg91SMS
and Msg91OTP
extend \Craftsys\Msg91\SMS\Options
and \Craftsys\Msg91\OTP\Options
, so all configuration methods are available when crafting your notification message. These are all optional and you can use them in any order. e.g.
Related
Acknowledgements
All versions of msg91-laravel-notification-channel with dependencies
craftsys/msg91-laravel Version ^0.15.1
illuminate/notifications Version ~5.8.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0