定制 sikhlana/laravel-greenweb-sms-channel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

sikhlana/laravel-greenweb-sms-channel

Composer 安装命令:

composer require sikhlana/laravel-greenweb-sms-channel

包简介

Greenweb SMS Notifications driver for Laravel.

README 文档

README

This package makes it easy to send SMS notifications via Greenweb for Laravel 5. Greenweb only provides SMS service for Bangladeshi mobile operators.

Contents

Installation

You can install the package via composer:

composer require sikhlana/laravel-greenweb-sms-channel

First you must install the service provider (skip for Laravel >= 5.5):

// config/app.php
'providers' => [
    ...
    Sikhlana\GreenwebSmsChannel\ServiceProvider::class,
],

Setting up the Greenweb service

Add your generated Greenweb SMS API key in your .env file:

...
GREENWEB_SMS_TOKEN=

Usage

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

use Sikhlana\GreenwebSmsChannel\GreenwebChannel;
use Sikhlana\GreenwebSmsChannel\GreenwebMessage;
use Illuminate\Notifications\Notification;

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

    public function toGreenweb($notifiable)
    {
        return (new GreenwebMessage())
            ->content("Your {$notifiable->service} account was approved!");
    }
}

In order to let your Notification know which phone are you sending/calling to, the channel will look for the phone_number attribute of the Notifiable model. If you want to override this behaviour, add the routeNotificationForGreenweb method to your Notifiable model.

public function routeNotificationForGreenweb()
{
    return '01765432109';
}

Available Message methods

GreenwebMessage

  • content(string): Sets the message content.
  • line(string): Adds a line of text to the notification.

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email xoxo@saifmahmud.name instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固