smsfactor/smsfactor-laravel
Composer 安装命令:
composer require smsfactor/smsfactor-laravel
包简介
Laravel package for SMSFactor API
README 文档
README
The Laravel Service Provider that allows you to use SMSFactor PHP Client library.
In order to use it, make sure to have an account. You can register here. Once your account is created, you need to generate your first API token. You can find the complete documentation of our API here.
Installation
We recommend using Composer to install the PHP client library to your project.
composer require smsfactor/smsfactor-laravel
Laravel 5.5+
If you're using Laravel 5.5 or above, the package will automatically register the SMSFactor provider and facades.
Laravel 5.4 and below
Add SMSFactor\Laravel\SMSFactorServiceProvider to the providers array in your config/app.php:
'providers' => [ // Other service providers... SMSFactor\Laravel\SMSFactorServiceProvider::class, ],
If you want to use the a facade interface, you can use any of them depending on your need:
use SMSFactor\Laravel\Facade\Account; use SMSFactor\Laravel\Facade\Campaign; use SMSFactor\Laravel\Facade\ContactList; use SMSFactor\Laravel\Facade\Message; use SMSFactor\Laravel\Facade\Webhook; use SMSFactor\Laravel\Facade\Token;
Or add any alias in your config/app.php:
'aliases' => [ ... 'SMSFactor' => SMSFactor\Laravel\Facade\Account::class, 'SMSFactor' => SMSFactor\Laravel\Facade\Campaign::class, 'SMSFactor' => SMSFactor\Laravel\Facade\ContactList::class, 'SMSFactor' => SMSFactor\Laravel\Facade\Message::class, 'SMSFactor' => SMSFactor\Laravel\Facade\Webhook::class, 'SMSFactor' => SMSFactor\Laravel\Facade\Token::class, ],
Configuration
You can use artisan vendor:publish to copy the distribution configuration file to your app's config directory:
php artisan vendor:publish
Then update config/smsfactor.php with your token.
Usage
To use the SMSFactor Client Library you can use the facades, or request an instance from the service container:
$response = Message::send([ 'to' => '33600000000', 'text' => 'Have you ever danced with the devil in the pale moonlight ?' ]); print_r($response->getJson()); //In case you don't receive your text, printing the API response might be useful
or
$account = app('SMSFactor\Message'); $response = $account->send([ 'to' => '33600000000', 'text' => 'Have you ever danced with the devil in the pale moonlight ?' ]); print_r($response->getJson());
smsfactor/smsfactor-laravel 适用场景与选型建议
smsfactor/smsfactor-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 47.19k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2019 年 09 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 smsfactor/smsfactor-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 smsfactor/smsfactor-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 47.19k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-03