承接 gdpa/kavenegar 相关项目开发

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

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

gdpa/kavenegar

Composer 安装命令:

composer require gdpa/kavenegar

包简介

Kavenegar Notifications driver

README 文档

README

Latest Version on Packagist Software License Build Status StyleCI Scrutinizer Code Quality Code Coverage Total Downloads

This package makes it easy to sent Kavenegar Notifications with Laravel 5.3+.

Contents

Installation

You can install the package via composer:

composer require gdpa/kavenegar

Install for laravel 7:

composer require gdpa/kavenegar:^3.4

Install for laravel 6:

composer require gdpa/kavenegar:^2.0

Install for laravel < 5.8:

composer require gdpa/kavenegar:^1.0

Setting up the Kavenegar service

Add your Kavenegar REST API Key to your config/services.php:

// config/services.php
...
'kavenegar' => [
    'api_key' => env('KAVENEGAR_API_KEY'), 
],
...

Usage

There are two channels that you can use in your via() method inside the notification: KavenegarChannel which represent simple send api and KavenegarVerifyChannel which provide verify lookup api.

use NotificationChannels\Kavenegar\KavenegarChannel;
use NotificationChannels\Kavenegar\KavenegarMessage;
use Illuminate\Notifications\Notification;

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

    public function toKavenegar($notifiable)
    {
        return KavenegarMessage::create()
            ->sender("your-desired-sender-number")
            ->message('Hello world');
    }
}
use NotificationChannels\Kavenegar\KavenegarVerifyChannel;
use NotificationChannels\Kavenegar\KavenegarMessage;
use Illuminate\Notifications\Notification;

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

    public function toKavenegar($notifiable)
    {
        return KavenegarMessage::create()
            ->template("your-template-key(Refer to Kavenegar Docs)")
            ->type('sms')
            ->token('your default token on your verify message template')
            ->token('additional token data. For example token10', 10);
    }
}

In order to let your Notification know which Kavenegar user you are targeting, add the routeNotificationForKavenegar method to your Notifiable model.

This method needs to return an array containing the mobile number of your receptor.

public function routeNotificationForKavenegar()
{
    return [
        'mobile_number' => 'receptor mobile number',
    ];
}

Available methods

  • sender(''): Accepts a string value for setting sender number on kavenegar.
  • message(): Accepts a string value for setting your sms message.
  • template(): Accepts a string value for setting your sms template.
  • type(): Accepts a string value for setting your service type (sms, voice, ...).
  • tokens(): Accepts two string value for setting your tokens. Second string is optional and in case you don't provide it, it set your default token.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

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

gdpa/kavenegar 适用场景与选型建议

gdpa/kavenegar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.71k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 08 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 gdpa/kavenegar 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-24