Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2024-04-27 (10 hours ago) ![]() | Not yet rated by the users | Total: Not yet counted | Not yet ranked |
Version | License | PHP version | Categories | |||
laravel-notification 1.0 | The PHP License | 5 | PHP 5, Wireless and Mobile, Web services |
Description | Author | |
This package can send messages to other people with the Termii API. |
|
This package brings you the joy of sending Termii notifications with Laravel, with the same effortlessness as a Sunday morning coffee. Take a sip and let's get started.
You can install the package faster than you can say "composer" via composer:
composer require infinitypaul/laravel-notification-channel-termii
Service providers... You gotta love them. You either have to install them yourself, or if you're living on the edge with Laravel 5.5 or higher, let the package auto discovery do the work for you:
// config/app.php
'providers' => [
...
Infinitypaul\Termii\TermiiServiceProvider::class,
],
Time to tell Laravel your deepest secret (aka your Termii API Key). Also, add your favorite channel and an optional Sender ID. Whisper these to your config/services.php:
// config/services.php
'termii' => [
'api_key' => env('TERMII_API_KEY'),
'from' => env('TERMII_FROM'),
'channel' => 'dnd' //because I know you love 'do not disturb' mode ?
]
The next step is as easy as pie. Simply use the channel in your via() method inside the notification:
use Infinitypaul\Termii\TermiiChannel;
use Infinitypaul\Termii\TermiiMessage;
use Illuminate\Notifications\Notification;
class WelcomeSMS extends Notification
{
public function via($notifiable)
{
return [TermiiChannel::class]; // see? pie!
}
public function toTermii($notifiable)
{
return (new TermiiMessage())
->content("Thanks For Subscribing to infinitypaul.medium.com. We promise to only send interesting stuff, no cat videos... well, maybe just one.");
}
}
Let's tell your Notification where it's heading(which phone are you sending to). Add the routeNotificationForTermii method to your Notifiable model (e.g., your User Model).
public function routeNotificationForTermii()
{
return $this->phone; // where `phone` is a field in your users table;
}
or you can also just send it from TermiiMessage
class in your toTermii()
implementation.
public function toTermii($notifiable)
{
return (new TermiiMessage())
->content("Thanks For Subscribing to infinitypaul.medium.com. We promise to only send interesting stuff, no cat videos... well, maybe just one.")
->to("234100000001");
}
Curious about our termii journey? Check out CHANGELOG for more information on what has changed recently.
composer test //(We promise it won't explode.)
Discovered any security issues? Please email us at infinitypaul@live.com. We promise to take it seriously, instead of using the issue tracker..
The MIT License (MIT). Please see License File for more information.
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() |
||||
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documentation |
Version Control | Unique User Downloads | |||||||
100% |
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.