danbka33/smstraffic-api-laravel
最新稳定版本:v1.0.4
Composer 安装命令:
composer require danbka33/smstraffic-api-laravel
包简介
SMS Traffic API implementation with Laravel support
README 文档
README
SMS Traffic is full-cycle SMS aggregator. This project is an implementation of API by HTTP Protocol.
Install via composer
composer require danbka33/smstraffic-api-laravel
This package makes use of Laravels package auto-discovery mechanism.
If for some reason you want manually control this:
- add the package to the
extra.laravel.dont-discoverkey incomposer.json, e.g."extra": { "laravel": { "dont-discover": [ "danbka33/smstraffic-api-laravel" ] } }
- Add the following class to the
providersarray inconfig/app.php:\Danbka33\SmsTrafficApi\Providers\SmsTrafficServiceProvider::class,
Environment Variables
SMS_TRAFFIC_LOGIN=login SMS_TRAFFIC_PASSWORD=password SMS_TRAFFIC_ORIGINATOR=originator
Lumen
To use the included config, copy it over to your config folder.
mkdir -p config cp vendor/danbka33/smstraffic-api-laravel/src/config/sms-traffic.php config/
Register the config file within your bootstrap/app.php file:
$app->configure('sms-traffic');
Register the service provider in your bootstrap/app.php file:
$app->register(\Danbka33\SmsTrafficApi\Providers\SmsTrafficServiceProvider::class);
Usage
use Danbka33\SmsTrafficApi\Client; use Danbka33\SmsTrafficApi\Sms\Sms; $client = app()->get(Client::class); $result = $client->send(new Sms($phone, $message));
Publish default config file
php artisan vendor:publish --tag=sms-traffic-config
return [ 'login' => env('SMS_TRAFFIC_LOGIN', ''), 'password' => env('SMS_TRAFFIC_PASSWORD', ''), 'originator' => env('SMS_TRAFFIC_ORIGINATOR', ''), ];
License
The SMS Traffic API with Laravel Support is open-sourced software licensed under the MIT license
统计信息
- 总下载量: 115
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-07-22