lijinhua / hyperf-sms
适用于hyperf的短信发送
v1.0.1
2023-10-25 08:12 UTC
Requires
- php: >=8.0
- hyperf/di: 3.0.*
- hyperf/framework: 3.0.*
- hyperf/guzzle: ^3.0
- hyperf/logger: ^3.0
- overtrue/easy-sms: ^2.5
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: >=7.0
- swoole/ide-helper: ^4.5
Suggests
- swow/swow: Required to create swow components.
This package is auto-updated.
Last update: 2025-03-29 01:07:37 UTC
README
兼容overtrue/easy-sms协程化,hyperf用户方便使用,详细使用请参考:https://github.com/overtrue/easy-sms
1.安装
composer require lijinhua/hyperf-sms
2.发布配置
php bin/hyperf.php vendor:publish lijinhua/hyperf-sms
3.基本调用
use Lijinhua\HyperfSms\Contract\SmsInterface;
use Hyperf\Context\ApplicationContext;
$easySms = ApplicationContext::getContainer()->get(SmsInterface::class);
$result = $easySms->send(18888888888, [
'content' => '{1}为您的登录验证码,请于5分钟内填写',
'template' => '12345',
'data' => [
'code' => 1234
],
]);