undjike/ekosms-laravel-notification-channel 问题修复 & 功能扩展

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

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

undjike/ekosms-laravel-notification-channel

Composer 安装命令:

composer require undjike/ekosms-laravel-notification-channel

包简介

Laravel Notification Channel based on EkoSMS service

README 文档

README

logo

Latest Stable Version License Total Downloads Dependents

Introduction

This is a package for Laravel Applications which enables you to send notifications through EkoSMS Channel.

The package uses EkoSms Service to perform SMS dispatching.

Installation

This package can be installed via composer. Just type :

composer require undjike/ekosms-laravel-notification-channel

Usage

After installation, configure your services in congig/services.php by adding :

<?php

return [
    //...

    'ekosms' => [
        'username' => env('EKOSMS_USERNAME'), // You can type in directly your credentials 
        'password' => env('EKOSMS_PASSWORD')
    ],
];

Once this is done, you can create your notification as usual.

<?php

namespace App\Notifications;

use Illuminate\Notifications\Notification;
use Undjike\EkoSmsNotificationChannel\EkoSmsChannel;
use Undjike\EkoSmsNotificationChannel\EkoSmsMessage;

class EkoSmsNotification extends Notification
{
    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [EkoSmsChannel::class]; // or return 'ekosms';
    }

    /**
     * @param $notifiable
     * @return mixed
     */
    public function toEkoSms($notifiable)
    {
        return EkoSmsMessage::create()
            ->body('Type here you message content...')
            ->sender('Brand name');
        // or return 'Type here you message content...';
    }
}

To get this stuff completely working, you need to add this to your notifiable model.

    /**
     * Attribute to use when addressing EkoSMS notification
     *
     * @returns string|array
     */
    public function routeNotificationForEkoSms()
    {
        return $this->phone_number; // Can be a string or an array of valid phone numbers
    }

Enjoy !!!

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固