承接 chevgenio/smspilot-notification-channel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

chevgenio/smspilot-notification-channel

Composer 安装命令:

composer require chevgenio/smspilot-notification-channel

包简介

SmsPilot Notifications channel for Laravel

README 文档

README

This package makes it easy to send notifications using smspilot.ru with Laravel 8.x.

Contents

Installation

Install this package with Composer:

composer require chevgenio/smspilot-notification-channel

Setting up the SmsPilot service

Add your SmsPilot api key, default sender name to your config/services.php:

// config/services.php
...
'smspilot' => [
    'apikey' => env('SMSPILOT_APIKEY'),
    'sender' => env('SMSPILOT_SENDER', 'INFORM'),
    'callback' => env('SMSPILOT_CALLBACK_URL', ''),
    'callback_method' => env('SMSPILOT_CALLBACK_METHOD', 'get'),
],
...

Usage

You can use the channel in your via() method inside the notification:

use Illuminate\Notifications\Notification;
use Chevgenio\SmsPilot\SmsPilotMessage;
use Chevgenio\SmsPilot\SmsPilotChannel;

class NewOrder extends Notification
{
    public function via($notifiable)
    {
        return [SmsPilotChannel::class];
    }

    public function toSmsPilot($notifiable)
    {
        return (new SmsPilotMessage)
            ->content("Order successfully completed.");
    }
}

In your notifiable model, make sure to include a routeNotificationForSmspilot method, which returns a phone number or an array of phone numbers.

public function routeNotificationForSmspilot()
{
    return $this->phone;
}

Available methods

from(): Sets the sender's name. Make sure to register the sender name at you SmsPilot dashboard.

content(): Set a content of the notification message.

sendAt(): Set a time for scheduling the notification message.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固