grambas/sms-gateway
Composer 安装命令:
composer require grambas/sms-gateway
包简介
API container for Laravel 5.2
关键字:
README 文档
README
Basic https://gatewayapi.com/ API Container for Laravel 5.*
Requirements
- "guzzlehttp/guzzle": "~6.0"
Install
Via Composer
$ composer require grambas/SmsGateway dev-master
Usage
Simple example to send sms
$client = new SmsGateway( 'API KEY','SECRET KEY'); // init client with api key and secret
$response = $client->send('SENDER NAME', '048139381038', 'Message content'); //send sms with paramters: sender name, phone nunbmer and message
if ( isset($response['ids']) ) { // if message is sent, then the system generates id. So if id exist, then the message is successfuly snent
return "Message successfuly sent! Cost: " . $response['usage']['total_cost'] . ' ' . $response['usage']['currency'];
}else{
return 'Error acquired during sending message';
}
Check balance
$client = new SmsGateway( 'API KEY','SECRET KEY');
$check = $client->me();
return 'New balance: ' . $check['credit'] . ' ' . $check['currency'];
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-11-06