pugofka/laravel-smsru-notification-channel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pugofka/laravel-smsru-notification-channel

最新稳定版本:1.0.0

Composer 安装命令:

composer require pugofka/laravel-smsru-notification-channel

包简介

SmsRu Notifications Driver

README 文档

README

This package makes it easy to send notifications using sms.ru with Laravel.

Contents

Installation

You can install this package via composer:

composer require pugofka/laravel-smsru-notification-channel

Next add the service provider to your config/app.php:

...
'providers' => [
    ...
     NotificationChannels\SmsRu\SmsRuServiceProvider::class,
],
...

Setting up the configuration

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'
],
...

Usage

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.

Available message methods

  • from(): Sets the sender's name.
  • text(): Sets a text of the notification message.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-29