All checks were successful
Tests / Laravel tests (pull_request) Successful in 12m3s
38 lines
1.0 KiB
PHP
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);
|
|
}
|
|
}
|