
$arrayForWriteLog = [
'domain' => $domain,
'message' => addslashes($record->message),
'level' => $record->level->name,
'json-payload' => addslashes(json_encode($jsonpayload))
];
jobCommetnsWriteToYandex::dispatch($arrayForWriteLog);<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use phpseclib3\Net\SSH2;
class jobCommetnsWriteToYandex implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private $arrayForWriteLog;
public function __construct($arrayForWriteLog)
{
$this->arrayForWriteLog = $arrayForWriteLog;
}
public function handle(): void
{
}
}
jobUpdateAndCreateB24Bill::dispatch($array['data']['FIELDS']['ID'], $this);<?php
namespace App\Jobs;
use App\Helpers\B24Helper;
use App\Helpers\MDHelper;
use App\Services\B24ApiService;
use App\Services\MDApiService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Log\Logger;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
/**
* Очередь для работы с обновление\созданием счет
*/
class jobUpdateAndCreateB24Bill implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private $billId;
private $b24Helper;
private Logger $logger;
/**
* Create a new job instance.
*/
public function __construct($billId, B24Helper $b24Helper, )
{
$this->billId = $billId;
$this->b24Helper = $b24Helper;
}
/**
* Execute the job.
*/
public function handle(): void
{
Log::debug('Очередь >>>>>>>>>. Старт очереди для счета Б24 id = '. $this->billId);
$this->b24Helper->queueUpdateAndCreateWorkB24MD($this->billId);
Log::debug('Очередь <<<<<<<<<. Конец очереди для счета Б24 id = '. $this->billId);
}
}