chore: code styling via pint
This commit is contained in:
@@ -2,18 +2,20 @@
|
||||
|
||||
namespace App;
|
||||
|
||||
use Log;
|
||||
use Http;
|
||||
use Exception;
|
||||
use Http;
|
||||
use Log;
|
||||
|
||||
trait NotifyMe
|
||||
{
|
||||
function sendTelegramNotification($message) {
|
||||
public function sendTelegramNotification($message)
|
||||
{
|
||||
$botToken = config('app.notify_tg_bot_token');
|
||||
$chatId = config('app.notify_tg_chat_id');
|
||||
|
||||
if (!$botToken || !$chatId) {
|
||||
if (! $botToken || ! $chatId) {
|
||||
Log::error('Telegram bot token or chat ID not configured');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,14 +24,16 @@ trait NotifyMe
|
||||
$data = [
|
||||
'chat_id' => $chatId,
|
||||
'text' => $message,
|
||||
'parse_mode' => 'HTML'
|
||||
'parse_mode' => 'HTML',
|
||||
];
|
||||
|
||||
try {
|
||||
$response = Http::post($url, $data);
|
||||
|
||||
return $response->successful();
|
||||
} catch (Exception $e) {
|
||||
Log::error('Failed to send Telegram notification: ' . $e->getMessage());
|
||||
Log::error('Failed to send Telegram notification: '.$e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user