humix / sms
v3.0.0
2026-08-10 05:56 UTC
Requires
- php: >=8.2
- hyperf/di: 3.2.*
- hyperf/framework: 3.2.*
- hyperf/guzzle: 3.2.*
- hyperf/logger: 3.2.*
- overtrue/easy-sms: 2.5.0
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.
Provides
None
Conflicts
None
Replaces
None
README
兼容 overtrue/easy-sms 协程化,方便 Hyperf 用户使用。详细用法见:https://github.com/overtrue/easy-sms
环境要求: Hyperf 3.2、PHP >= 8.2
1.安装
composer require humx/hyperf-sms:2.0.0
2.发布配置
php bin/hyperf.php vendor:publish humx/hyperf-sms
3.基本调用
use Humx\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
],
]);