hotifyru/hotify

Hotify.ru

dev-master 2022-07-06 12:17 UTC

This package is auto-updated.

Last update: 2024-09-06 17:28:30 UTC


README

使用

只需几行代码

$apiToken = YOUR_TOKEN_HERE;
$appId = YOUR_APP_ID_OR_TAG_HERE; 

$hotify = new Hotify($apiToken);
$hotify
    ->title('First notification') //optional
    ->text('Hello World!')
    ->to($appId)
    ->send();

这就完了!

Laravel

您可以将此包用作Laravel日志记录器。

php artisan vendor:publish --provider="Hotify\Hotify\HotifyServiceProvider" --tag="config"

config/logging.php 中创建日志配置

...
'hotify' => [
    'driver' => 'custom',
    'via'    => \Hotify\Hotify\HotifyLogger::class,
    'level'  => 'debug',
],
...

然后使用它!

Log::channel('hotify')->info('Hello world');