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

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

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

helliomessaging/helliomessaging-laravel-notification-channel

Composer 安装命令:

composer require helliomessaging/helliomessaging-laravel-notification-channel

包简介

Helliomessaging Notification Channel for Laravel 5.3+

README 文档

README

Latest Stable Version Total Downloads License

This package makes it easy to send notifications using Hellio Messaging

Content

Installation

To get the latest version of Hellio Messaging Notification channel is intended for Laravel 5.5 and up, simply require the project using Composer:

composer require helliomessaging/helliomessaging-laravel-notification-channel

If you use Laravel 5.5+ you don't need the following step. If not, once package is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.

  • NotificationChannels\Hellio\HellioServiceProvider::class

Setting up the Hellio Messaging Service

First, you must have an account with Hellio. Once you've registered for an account, login into your account and click on the Profile & API Integration menu on your Hellio Messaging dashboard. Click on the API Keys & Webhooks tab and copy your Client ID and Application Secret

In your terminal run

php artisan vendor:publish --provider="NotificationChannels\Hellio\HellioServiceProvider"

This creates a hellio.php file in your config directory.

Paste your api keys in the config/hellio.php configuration file. You may copy the example configuration below to get started:

<?php

return [
    'config' => [
        'client_id' => env('HELLIO_CLIENT_ID'),
        'app_secret' => env('HELLIO_APP_SECRET')
    ],

];

Or

Add the HELLIO_CLIENT_ID and HELLIO_APP_SECRET to your .env file

Usage

Now you can use the channel in your via() method in any notification you want to send using Hellio Messaging:

<?php

use Illuminate\Notifications\Notification;
use NotificationChannels\Hellio\HellioChannel;
use NotificationChannels\Hellio\HellioMessage;

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

    public function toHellioSMS($notifiable)
    {
        return (new HellioMessage)
   ->from("HellioSMS")
   ->to("233242813656") //Add the country code to the number you wish to send to without the need to add the  +
              ->content("Welcome to Hellio Messaging, a new world of litmitless possibilities.")
              ->messageType(0); //0 = text, 1 = flash
    }
}

In order to let your Notification know which phone number you are sending to, add the routeNotificationForHellioSMS method to your Notifiable model e.g your User Model

public function routeNotificationForHellioSMS()
{
    return $this->phone; // where phone is a column in your users table;
}

Available Message methods

  • from($from) : set the sender's id
  • senderID($id): an alias for from($from)
  • to($to) : set the recipient's phone number
  • msisdn($msisdn): an alias for to($to)
  • messageType($messageType): an alias for type($type)
  • content($content) : set the message content
  • message($message): an alias for content($content)

Read more about the available methods on the Hellio Messaging Documentation Portal

Testing

composer test

Security

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

helliomessaging/helliomessaging-laravel-notification-channel 适用场景与选型建议

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

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

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

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

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