pyrobyteweb / sms
此包最新版本(dev-master)的许可证信息不可用。
dev-master
2021-12-29 03:14 UTC
Requires
- php: ^7.4|^8.0
- ext-curl: *
- illuminate/support: ^6.0|^7.0|^8.0
This package is auto-updated.
Last update: 2024-09-29 06:14:35 UTC
README
Laravel 8+
PHP 7.4+
- 在文件 app.php 的 packages 部分添加:\PyrobyteWeb\Sms\SmsServiceProvider::class
php artisan vendor:publish --provider="PyrobyteWeb\Sms\SmsServiceProvider"- 在 .env 文件中添加参数 SMS_RU_KEY 并指定 SMS_RU 的令牌
- 在 config/sms.php 中指定发送短信所需的提供者。目前只支持
smsru
可用方法
操作通过 PyrobyteWeb\Sms\Facades\Sms 门面进行
- 发送消息的方法 -
send(SmsSendDTO $data): SmsResponse - 获取发送消息状态的方法 -
getStatus(string $smsId): SmsResponse - 获取余额的方法 -
getBalance(): SmsResponse
示例使用
\PyrobyteWeb\Sms\Facades\Sms::send(new \PyrobyteWeb\Sms\DTO\SmsSendDTO('71234567890', 'Тест'));
\PyrobyteWeb\Sms\Facades\Sms::getStatus('123456-123456');
\PyrobyteWeb\Sms\Facades\Sms::getBalance();