ping2me /
Laravel 对 Ping2.me 的客户端
v0.1.1
2023-12-19 11:47 UTC
Requires
- php: ^7|^8
- illuminate/contracts: ^10.37
- illuminate/support: ^10.37
- ping2me/php: ^0.2
Requires (Dev)
- orchestra/testbench: ^8.18
- pestphp/pest: ^2.28
README
这是 Laravel 的 ping2.me 包。
安装
composer require ping2me/laravel
配置
更新你的 config/services.php
文件如下
// other services 'ping2me' => [ 'endpoint' => env('PING2ME_ENDPOINT'), ],
这样你就可以在你的 .env
文件中设置你的端点
PING2ME_ENDPOINT=@daudau/ping2me
使用
\Ping2Me\Laravel\Facades\Ping::send('Hello world!'); // or ping('Hello world!');
然后消息将立即发送到你的 Telegram(或 Discord、Slack)频道。
性能
无需担心性能,如果你的服务器已安装 curl
(几乎每台服务器都有),则该包将在后台发送请求。所以关于 HTTP 请求的延迟几乎为零。