Files
cv-roberto/app/Jobs/NotifyTelegramAboutPersonaliaClick.php
Roberto da4bdc6bf4
All checks were successful
Tests / Laravel tests (pull_request) Successful in 12m3s
Add proxy IP headers to Telegram notifications
2026-06-04 00:30:44 +02:00

38 lines
1.0 KiB
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;
/**
* @param array<string, string|null> $ipHeaders
*/
public function __construct(Personalia $personalia, ?string $ip, ?string $userAgent, protected array $ipHeaders = [])
{
$this->personalia = $personalia;
$this->ip = $ip;
$this->userAgent = $userAgent;
}
public function handle(TelegramNotificationService $telegram): void
{
$telegram->notifyPersonaliaClick($this->personalia, $this->ip, $this->userAgent, $this->ipHeaders);
}
}