medkad/laravel-isms 问题修复 & 功能扩展

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

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

medkad/laravel-isms

Composer 安装命令:

composer require medkad/laravel-isms

包简介

Laravel Notification Channel For iSMS

README 文档

README

Getting started

Please register to your account credentials at iSMS Official Website. The API is using Basic Authentication(so username and password will do).

Installation

via composer:

composer require medkad/laravel-isms

Publish iSMS Config File

php artisan vendor:publish --provider="Medkad\ISMS\ISMSServiceProvider"

Setting up your configuration

Add your ISMS Account credentials to your config/isms.php:

// config/isms.php
...
    'username'  =>  env('ISMS_USERNAME', 'medkad'),
    'password'  =>  env('ISMS_PASSWORD', 'password'),
    'url'   =>  env('ISMS_URL', 'https://www.isms.com.my/RESTAPI.php'),
...
// .env
...
ISMS_USERNAME=
ISMS_PASSWORD=
ISMS_URL='https://www.isms.com.my/RESTAPI.php'
...

In order to let your Notification know which phone are you sending to, the channel will look for the mobile_number attribute of the Notifiable model (eg. User model). If you want to override this behaviour, add the routeNotificationForISMS method to your Notifiable model.

public function routeNotificationForISMS()
{
    return $this->phone_number;
}

Usage

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

use Medkad\ISMS\ISMS;
use Medkad\ISMS\ISMSChannel;
use Illuminate\Notifications\Notification;

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

    public function toISMS($notifiable)
    {
        return new ISMS('Your SMS Here!');
    }
}

License

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

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固