定制 undjike/camoo-laravel-notification-channel 二次开发

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

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

undjike/camoo-laravel-notification-channel

最新稳定版本:v1.0.3

Composer 安装命令:

composer require undjike/camoo-laravel-notification-channel

包简介

Laravel Notification Channel based on Camoo SMS 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 Camoo SMS Channel.

The package uses Camoo SMS Service to perform SMS dispatching.

Installation

This package can be installed via composer. Just type :

composer require undjike/camoo-laravel-notification-channel

Usage

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

<?php

return [
    //...

    'camoo' => [
        'key' => env('CAMOO_API_KEY'), // Your credentials 
        'secret' => env('CAMOO_SECRET_KEY')
    ],
];

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

<?php

namespace App\Notifications;

use Illuminate\Notifications\Notification;
use Undjike\CamooNotificationChannel\CamooChannel;
use Undjike\CamooNotificationChannel\CamooMessage;

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

    /**
     * @param $notifiable
     * @return mixed
     */
    public function toCamoo($notifiable)
    {
        return CamooMessage::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 Camoo SMS notification
     *
     * @returns string|array
     */
    public function routeNotificationForCamoo()
    {
        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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-31