multicaret/laravel-unifonic
Composer 安装命令:
composer require multicaret/laravel-unifonic
包简介
A library to integrate with Unifonic API to send SMS
README 文档
README
Laravel Unifonic 8.x +
Start sending SMS with Unifonic right away using Laravel.
Installation
First, install the package through Composer.
$ composer require multicaret/laravel-unifonic
Laravel 5.5 and up
You don't have to do anything else, this package uses the package Auto-Discovery feature, and should be available as soon as you install it via Composer.
Laravel 5.4 and below
Then include the service provider inside config/app.php.
'providers' => [ ... Multicaret\Unifonic\UnifonicServiceProvider::class, ... ];
And add the alias as well
'aliases' => [ ... 'Unifonic' => Multicaret\Unifonic\UnifonicFacade::class, ... ],
Configurations
Head to Dashboard to create a new Application (check image below if you wish). Within in this app, you will find the APP SID copy it please. Now add these to your config/services.php file:
'unifonic' => [
'app_id' => env('UNIFONIC_APP_ID'),
'sender_id' => env('UNIFONIC_SENDER_ID'), // String, Optional
'account_email' => env('UNIFONIC_ACCOUNT_EMAIL'),
'account_password' => env('UNIFONIC_ACCOUNT_PASSWORD')
],
Now Place these in your .env file.
UNIFONIC_APP_ID=
UNIFONIC_SENDER_ID=
UNIFONIC_ACCOUNT_EMAIL=
UNIFONIC_ACCOUNT_PASSWORD=
Usage
Account related methods:
// To test credentials and make sure the APP SID, email & password are set correctly. Unifonic::retrieveCredentialsForTesting();
Messages related methods:
Unifonic::send(int $recipient, string $message, string $senderID = null); Unifonic::getMessageIDStatus(int $messageID);
You may make asynchronous calls to Unifonic API, by prefixing your methods with the async() function:
Unifonic::async(true); // async calls on, default value is true Unifonic::async(false);// async calls off // Later you can append the callback() to be executed when the response returns. Unifonic::async()->callback(Callable $requestCallback);
For more details about the parameters please refer to the Api Documentation for more info, or read the source code.
Contributing
See the CONTRIBUTING guide.
Changelog
Please see CHANGELOG for more information about what has changed recently.
multicaret/laravel-unifonic 适用场景与选型建议
multicaret/laravel-unifonic 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 191.26k 次下载、GitHub Stars 达 25, 最近一次更新时间为 2020 年 04 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「sms」 「laravel」 「verify」 「2fa」 「tts」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 multicaret/laravel-unifonic 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 multicaret/laravel-unifonic 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 multicaret/laravel-unifonic 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Extensible library for building notifications and sending them via different delivery channels.
yii2-sms expand
Alfabank REST API integration
A fork of simplesoftwareio/simple-sms with Verimor driver.
统计信息
- 总下载量: 191.26k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 25
- 点击次数: 37
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-22