31 lines
839 B
PHP
31 lines
839 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
|
|
*/
|
|
public function __construct(
|
|
protected array $visit,
|
|
protected ?string $ip,
|
|
protected ?string $userAgent,
|
|
protected ?string $acceptLanguage
|
|
) {}
|
|
|
|
public function handle(TelegramNotificationService $telegram): void
|
|
{
|
|
$telegram->notifyPageVisit($this->visit, $this->ip, $this->userAgent, $this->acceptLanguage);
|
|
}
|
|
}
|