<?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 Maatwebsite\Excel\Facades\Excel;
use App\Imports\ImportSipd;
use Illuminate\Support\Facades\Cache;
class ImportSIPDJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $filePath;
public $batchId;
public function __construct($filePath, $batchId)
{
$this->filePath = $filePath;
$this->batchId = $batchId;
}
public function handle()
{
// $connection = \DB::connection('2024');
// $file = public_path('storage/imports/' . $this->filePath);
// Initialize progress tracking
// Cache::put("import_progress_{$this->batchId}", 0);
Excel::import(new ImportSipd($this->batchId), $this->filePath);
// Once done, set progress to 100
// Cache::put("import_progress_{$this->batchId}", 100);
}
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]