Add page visit Telegram notifications
Some checks failed
Tests / Laravel tests (pull_request) Failing after 6m57s

This commit is contained in:
2026-06-03 23:19:06 +02:00
parent fdc10a0acb
commit bbfc64031f
10 changed files with 434 additions and 45 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Jobs;
use App\Services\TelegramNotificationService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class NotifyTelegramAboutPageVisit implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* @param array<string, mixed> $visit
*/
public function __construct(
protected array $visit,
protected ?string $ip,
protected ?string $userAgent,
protected ?string $acceptLanguage
) {}
public function handle(TelegramNotificationService $telegram): void
{
$telegram->notifyPageVisit($this->visit, $this->ip, $this->userAgent, $this->acceptLanguage);
}
}