| Package Data | |
|---|---|
| Maintainer Username: | enniel |
| Maintainer Contact: | razumov.evgeni@gmail.com (Evgeni Razumov (Enniel)) |
| Package Create Date: | 2016-10-03 |
| Package Last Update: | 2016-10-11 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-19 15:22:53 |
| Package Statistics | |
|---|---|
| Total Downloads: | 11,387 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 4 |
| Total Watchers: | 1 |
| Total Forks: | 1 |
| Total Open Issues: | 0 |
This package makes it easy to send notifications using sms.ru with Laravel 5.3.
You can install this package via composer:
composer require enniel/laravel-smsru-notification-channel
Next add the service provider to your config/app.php:
...
'providers' => [
...
NotificationChannels\SmsRu\SmsRuServiceProvider::class,
],
...
Add your API ID (secret key) and default sender name to your config/services.php:
// config/services.php
...
'smsru' => [
'api_id' => env('SMSRU_API_ID'),
'sender' => 'John_Doe'
],
...
Now you can use the channel in your via() method inside the notification:
use NotificationChannels\SmsRu\SmsRuChannel;
use NotificationChannels\SmsRu\SmsRuMessage;
use Illuminate\Notifications\Notification;
class ExampleNotification extends Notification
{
public function via($notifiable)
{
return [SmsRuChannel::class];
}
public function toSmsRu($notifiable)
{
return SmsRuMessage::create('message text');
}
}
In order to let your Notification know which phone number you are targeting, add the routeNotificationForSmsRu method to your Notifiable model.
from(): Sets the sender's name.text(): Sets a text of the notification message.$ composer test
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.