natsumework/laravel-notification-mitake 问题修复 & 功能扩展

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

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

natsumework/laravel-notification-mitake

Composer 安装命令:

composer require natsumework/laravel-notification-mitake

包简介

:package_description

README 文档

README

Latest Version on Packagist Software License Total Downloads

This package(non-official) makes it easy to send notifications using Mitake with Laravel 5.5+ and 6.x and 7.x

Here's the latest documentation on Laravel's Notifications System:

https://laravel.com/docs/master/notifications

Contents

Installation

composer require natsumework/laravel-notification-mitake

Setting up the Mitake service

Add your Mitake Account, Password, and Api endpoint url (optional) to your config/services.php:

// config/services.php
...
'mitake' => [
    'username' => env('MITAKE_USERNAME'), // reqired
    'password' => env('MITAKE_PASSWORD'), // reqired
    'url' => env('MITAKE_URL'), // optional (has default value): e.g. 'https://{三竹網域名稱}/api/mtk/SmSend
],
...

Usage

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

use NotificationChannels\Mitake\MitakeChannel;
use NotificationChannels\Mitake\MitakeMessage;
use Illuminate\Notifications\Notification;

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

    public function toMitake($notifiable)
    {
        return (new MitakeMessage())
            ->content("Your message...");
    }
}

You can also set 'dstaddr' or 'vldtime' or 'clientid' option (about the options please refer to the mitake api docs):

class SmsNotification extends Notification
{
    ...
    public function toMitake($notifiable)
    {
           return (new MitakeMessage())
                ->content("Your message...")
                ->to("0900000000") // dstaddr: phone number
                ->vldTime("900")  // Validity period: 900 second
                ->clientId("ce910656-7bd1-11ea-bc55-0242ac130003"); //Check duplicate sending
    }
    ...

Phone number

In order to let your Notification know which phone are you sending to, you need to set the phone number in MitakeMessage

class SmsNotification extends Notification
{
    ...
    public function toMitake($notifiable)
    {
           return (new MitakeMessage())
                ->to("0900000000") // dstaddr: phone number 
                ...
    }
    ...

You can also add the routeNotificationForMitake method to your Notifiable model.

public function routeNotificationForMitake()
{
    return '0900000000';
}

or you can use the on-demand-notifications

Notification::route('mitake', '0900000000')
           ->notify(new SmsNotification($message));

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

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

natsumework/laravel-notification-mitake 适用场景与选型建议

natsumework/laravel-notification-mitake 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 383 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 04 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 natsumework/laravel-notification-mitake 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 natsumework/laravel-notification-mitake 我们能提供哪些服务?
定制开发 / 二次开发

基于 natsumework/laravel-notification-mitake 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-11