ThinkPHP 扩展包 网站链接提交
composer require xiaodi/think-site-pusher
项目根目录 config/push.php
use EasyPush\Facade\Pusher;
$config = ['site' => 'xxx', 'token' => 'xxx'];
Pusher::baidu($config)->urls($urls);
use EasyPush\Facade\Pusher;
$urls = [
'https://www.xiaodim.com/index.html',
'https://www.xiaodim.com/2019/10/25/thinkphp6-rpc-tutorial/'
]
// 推送链接
Pusher::baidu()->push($urls);
// 更新链接
Pusher::baidu()->update($urls);
// 删除链接
Pusher::baidu()->delete($urls);
$urls = [
'https://www.xiaodim.com/index.html',
'https://www.xiaodim.com/2019/10/25/thinkphp6-rpc-tutorial/'
]
// 推送链接
app('pusher')->baidu()->push($url);
// 更新链接
app('pusher')->baidu()->update($urls);
// 删除链接
app('pusher')->baidu()->delete($urls);