承接 medkad/laravel-isms 相关项目开发

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

邮箱: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
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

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