35 lines
923 B
PHP
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);
|
|
}
|
|
}
|