定制 bitfumes/karix-notification-channel 二次开发

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

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

bitfumes/karix-notification-channel

Composer 安装命令:

composer require bitfumes/karix-notification-channel

包简介

Allow you to use karix sms as custom channel in laravel notifications

README 文档

README

Build Status StyleCI GitHub license GitHub stars

This package makes it easy to send sms via Karix.io with Laravel 5.4+.

Installation

You can install the package via composer:

composer require bitfumes/karix-notification-channel

Setting up the Karix id and token

Login to Karix.io and get your ID and Token, put that on your .env file and add your Karix Id and Token to your config/services.php:

// config/services.php
...
    'karix' => [
        'id' => env('KARIX_ID'),
        'token' => env('KARIX_TOKEN'),
    ],
...

Usage

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

use Bitfumes\KarixNotificationChannel\KarixChannel;
use Bitfumes\KarixNotificationChannel\KarixMessage;
use Illuminate\Notifications\Notification;

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

    public function toKarix($notifiable)
    {
        return KarixMessage::create()
                        ->from('+1XXXXXXXXXX')
                        ->content('Your message comes here');
    }
}

In order to let your Notification know that there is a new channel called KarixSmsChannel, add the routeNotificationForKarix method to your Notifiable model (probably your user.php file).

This method needs to return email of the user (if it's a private board) and the list ID of the Trello list to add the card to.

Caveat : Make sure you have a 'phone' field in your table along with country code like +91xxxxxxxxxx for which you are using this.

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

Available methods

  • version(''): Accepts a string value for the Karix api version.
  • timezone(''): Accepts a string value for the TimeZone if you want to set for sms.

Testing

$ composer test

Security

If you discover any security related issues, please email sarthak@bitfumes.com 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.

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 3
  • Forks: 7
  • 开发语言: PHP

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固