grafstorm/laravel-46elks-notification-channel
Composer 安装命令:
composer require grafstorm/laravel-46elks-notification-channel
包简介
46 Elks Laravel Notification Channel
README 文档
README
Disclaimer: Not a finished package! If you are looking for a finished package to user for 46elks perhaps look at: https://github.com/laravel-notification-channels/46elks
Laravel SMS notification Channel for 46elks.se sms provider.
Installation
You can install the package via composer:
composer require grafstorm/laravel-46elks-notification-channel
Be sure to set User, Password and Sender in your .env file. Sender is limited to a alphaumeric string of maximum 11 characters([A-Za-z0-9]) or a correctly formatted E.164 phonenumber.
FORTY_SIX_ELKS_USER=::username:: FORTY_SIX_ELKS_PASS=::password:: FORTY_SIX_ELKS_FROM=::sender::
You can publish the config file if you want to override the default settings.
return [ 'user' => env('FORTY_SIX_ELKS_USER'), 'pass' => env('FORTY_SIX_ELKS_PASS'), 'from' => env('FORTY_SIX_ELKS_FROM', '46ELKS'), 'base_url' => env('FORTY_SIX_ELKS_BASE_URL', 'https://api.46elks.com/a1/') ];
You can publish the config file with:
php artisan vendor:publish --provider="Grafstorm\FortySixElksChannel\FortySixElksChannelServiceProvider" --tag="46elks-notification-channel-config"
Usage
Add Grafstorm\FortySixElksChannel\FortySixElksChannel::class in the via method in your notification.
And be sure to add a toFortySixElks method that returns an array with the mobile number and the message.
use Grafstorm\FortySixElksChannel\FortySixElksChannel; use Grafstorm\FortySixElksChannel\SmsMessage; /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return [FortySixElksChannel::class]; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * @return string[] */ public function toFortySixElks($notifiable): SmsMessage { // Return a SmsMessage. Needs to and message. // To needs to be formatted as a [E.164](https://en.wikipedia.org/wiki/E.164) phonenumber. (Eg. +4612345678) return (new SmsMessage()) ->from('developer') ->to($notifiable->mobile) ->line('Hello World') ->line('') ->line('Bye world.'); }
Sending a oneoff text message
You can also use the FortySixElks facade to send a message directly in your application.
use Grafstorm\FortySixElksChannel\SmsMessage; use Grafstorm\FortySixElksChannel\Facades\FortySixElks; $message = (new SmsMessage()) ->to('+461') ->line('Hello World'); $sms = FortySixElks::create($message)->send(); // Use dryRun() to test sending the message. $sms = FortySixElks::create($message)->dryRun()->send();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
grafstorm/laravel-46elks-notification-channel 适用场景与选型建议
grafstorm/laravel-46elks-notification-channel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 182 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「grafstorm」 「laravel-46elks-notification-channel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 grafstorm/laravel-46elks-notification-channel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 grafstorm/laravel-46elks-notification-channel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 grafstorm/laravel-46elks-notification-channel 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
统计信息
- 总下载量: 182
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-25