Files
cv-roberto/app/Jobs/NotifyTelegramAboutPersonaliaClick.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

35 lines
923 B
PHP

<?php
namespace App\Jobs;
use App\Models\Personalia;
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 NotifyTelegramAboutPersonaliaClick implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected Personalia $personalia;
protected ?string $ip;
protected ?string $userAgent;
public function __construct(Personalia $personalia, ?string $ip, ?string $userAgent)
{
$this->personalia = $personalia;
$this->ip = $ip;
$this->userAgent = $userAgent;
}
public function handle(TelegramNotificationService $telegram): void
{
$telegram->notifyPersonaliaClick($this->personalia, $this->ip, $this->userAgent);
}
}