Files
cv-roberto/app/Jobs/NotifyTelegramAboutPageVisit.php
Roberto bbfc64031f
Some checks failed
Tests / Laravel tests (pull_request) Failing after 6m57s
Add page visit Telegram notifications
2026-06-03 23:19:06 +02:00

31 lines
839 B
PHP

<?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);
}
}