All checks were successful
Tests / Laravel tests (pull_request) Successful in 12m3s
33 lines
952 B
PHP
33 lines
952 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
|
|
* @param array<string, string|null> $ipHeaders
|
|
*/
|
|
public function __construct(
|
|
protected array $visit,
|
|
protected ?string $ip,
|
|
protected ?string $userAgent,
|
|
protected ?string $acceptLanguage,
|
|
protected array $ipHeaders = []
|
|
) {}
|
|
|
|
public function handle(TelegramNotificationService $telegram): void
|
|
{
|
|
$telegram->notifyPageVisit($this->visit, $this->ip, $this->userAgent, $this->acceptLanguage, $this->ipHeaders);
|
|
}
|
|
}
|