这个配置文件:
'providers' => [
'example' => [
'host' => '10.120.2.41',
'port' => 10010,
'timeout' => 90,
'login' => 'test',
'password' => 'test'
]
],
<?php
命名空间App\Http\Controllers;
使用LaravelSmpp\SmppServiceInterface;
class SmsController extends Controller {
protected $smpp;
public function __construct(SmppServiceInterface $smpp)
{
$this->smpp = $smpp;
}
public function send()
{
$this->smpp->sendOne('211912230091', 'SMS message');
}
}
1条答案
按热度按时间w1jd8yoj1#
尝试使用此库:https://github.com/alexandr-mironov/php-smpp
自述文件中的示例对我来说非常好,你可以在配置文件中添加这样的内容:
祝你好运