devhereco / malathsms
此包已被弃用,不再维护。未建议替代包。
Malath SMS API 的 Laravel 包。
1.0.6
2022-03-20 20:07 UTC
Requires
- guzzlehttp/guzzle: ^7.4
README
Malath SMS 是一个 Laravel 包,通过几行简单的代码提供使用 malath API 服务的功能。
安装
1. 使用 Composer 安装
- composer require guzzle/guzzle - composer require devhereco/malathsms
2. 添加服务提供者(Laravel 5.4 及以下版本)
最新版本的 Laravel 具有自动发现和自动添加服务提供者的功能 - 如果您使用的是 5.4.x 及以下版本,请记住将其添加到 /app/config/app.php
中的 providers
数组。
// ... Devhereco\MalathSMS\ServiceProvider::class,
3. 迁移
php artisan migrate
4. 环境变量
MALATH_SMS_USERNAME= MALATH_SMS_PASSWORD= MALATH_SMS_SENDER=
用法
1. 单向消息
此功能将允许您向所选号码发送消息。
示例
use Devhereco\MalathSMS\MalathSMS; MalathSMS::sendOneSide('966555644047', 'Test Message'); // MalathSMS::sendOneSide(Receiver Number, Message);
2. 获取账户余额
此功能将在您的后端显示 Malath 账户余额。
示例
use Devhereco\MalathSMS\MalathSMS; MalathSMS::getBalance();