pyaesone17/sms-poh
Composer 安装命令:
composer require pyaesone17/sms-poh
包简介
SmsPoh Sdk for laravel
关键字:
README 文档
README
This is my personal library to make it easier for developers. This is not offical SDK for smspoh. The main goal to create this package is I hate curl , guzzle or etc .... And I made abstraction. Now I could use easily by calling like this. That is it.
send_smspoh( ['+959790646062','+95943160544'], 'Nice to meet you' );
Install
Via Composer
$ composer require pyaesone17/sms-poh:^1.1
Set Up
Publish the config file first.
$ php artisan vendor:publish
Configure the token in the sms-poh.php config file.
'token' => env('SMS_POH_TOKEN', 'Your_token_from_the_dashboard'),
SDK Usage
For fetching messages.
- Using Facade
$results = SmsPohFacade::fetch(1);
2.Using Container
$sms = app()->make(pyaesone17\SmsPoh\SmsPoh::class); $results = $sms->fetch(1);
3.Using function
$resutls = fetch_smspoh(1);
For sending messages.
- Using Facade
$results = SmsPohFacade::send( ['+959790646062','+95943160544'], 'Nice to meet you' ); $results = SmsPohFacade::send( '+959790646062', 'Nice to meet you' );
2.Using Container
$sms = app()->make(pyaesone17\SmsPoh\SmsPoh::class); $results = $sms->send( ['+959790646062','+95943160544'], 'Nice to meet you' );
3.Using function
$results = send_smspoh( ['+959790646062','+95943160544'], 'Nice to meet you' );
If you want to send message as testing purpose, you could pass true as a third parameter.
Notification Channel Usage
This package also include custom notification channel for interacting with Laravel Notification features. Here is how to use it.
class SendSmsPohNotification extends Notification { use Queueable; public $message; /** * Create a new notification instance. * * @return void */ public function __construct($message) { $this->message = $message; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * @return array */ public function via($notifiable) { return [pyaesone17\SmsPoh\SmsPohChannel::class]; } /** * Get the sms representation of the notification. * * @param mixed $notifiable * @return array */ public function toMMSms($notifiable) { return [ 'message' => $this->message, 'to' => '+959790646062', 'test' => 1, 'callback' => function (...$result) { // After sms is being sent or failed // The callback will fire, here you can // do whatever you want with the result. // If you don't want, just pass as null dd($result); } ]; }
And Notify like this
$user = App\User::first();
$user->notify(new App\Notifications\SendSmsPohNotification("Hello world"));
License
The MIT License (MIT). Please see License File for more information.
pyaesone17/sms-poh 适用场景与选型建议
pyaesone17/sms-poh 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.81k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2018 年 01 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「pyaesone17」 「SmsPoh」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pyaesone17/sms-poh 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pyaesone17/sms-poh 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pyaesone17/sms-poh 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Smspoh Notifications channel
A library for phone verification via Laravel notification channels. Any notification channel can be used as a sender, and Redis or MongoDB can be used as a storage.
A bundle for phone verification via the Symfony Notifier SMS channel. Any SMS service can be used as a sender. Redis or MongoDB can be used as a storage.
Small and minimalist but effective Laravel library to reduce your s3 billing dramatically just by calling custom asset function.
:package_description
统计信息
- 总下载量: 2.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 23
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-12