2021-06-29 09:22:20 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Abstracts;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
|
use Maatwebsite\Excel\Concerns\Importable;
|
|
|
|
|
use Maatwebsite\Excel\Concerns\WithChunkReading;
|
2024-01-29 14:02:01 +00:00
|
|
|
use Maatwebsite\Excel\Concerns\SkipsUnknownSheets;
|
2021-06-29 09:22:20 +00:00
|
|
|
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
|
|
|
|
|
|
2024-01-29 14:02:01 +00:00
|
|
|
abstract class ImportMultipleSheets implements ShouldQueue, WithChunkReading, WithMultipleSheets, SkipsUnknownSheets
|
2021-06-29 09:22:20 +00:00
|
|
|
{
|
|
|
|
|
use Importable;
|
|
|
|
|
|
|
|
|
|
public $user;
|
|
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
$this->user = user();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function chunkSize(): int
|
|
|
|
|
{
|
2023-05-18 11:23:17 +00:00
|
|
|
return config('excel.imports.chunk_size');
|
2021-06-29 09:22:20 +00:00
|
|
|
}
|
2024-01-29 14:02:01 +00:00
|
|
|
|
|
|
|
|
public function onUnknownSheet($sheetName)
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
}
|
2021-06-29 09:22:20 +00:00
|
|
|
}
|