<?php
namespace App\Jobs;
use App\Models\ProductModel;
use App\Services\AdminService;
use App\Services\Product\ElasticsearchService;
use App\Services\TelegramService;
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;
class ProductCreateJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public ProductModel $product;
public function __construct(ProductModel $product)
{
$this->product = $product;
}
public function handle()
{
ElasticsearchService::runCreate($this->product);
}
}