diff --git a/src/ModelRecordImport.php b/src/ModelRecordImport.php index 93a5639..c9a3f08 100644 --- a/src/ModelRecordImport.php +++ b/src/ModelRecordImport.php @@ -19,9 +19,10 @@ use FromHome\ModelUpload\Models\ModelUploadRecord; use Maatwebsite\Excel\Concerns\SkipsUnknownSheets; use Maatwebsite\Excel\Concerns\WithMultipleSheets; +use Maatwebsite\Excel\Concerns\WithCustomStartCell; use FromHome\ModelUpload\Jobs\ProcessModelRecordJob; -final class ModelRecordImport implements ShouldQueue, SkipsUnknownSheets, ToModel, WithBatchInserts, WithChunkReading, WithEvents, WithHeadingRow, WithMultipleSheets +final class ModelRecordImport implements ShouldQueue, SkipsUnknownSheets, ToModel, WithBatchInserts, WithChunkReading, WithCustomStartCell, WithEvents, WithHeadingRow, WithMultipleSheets { use Importable; @@ -101,4 +102,9 @@ public function sheets(): array public function onUnknownSheet($sheetName): void { } + + public function startCell(): string + { + return ModelUpload::importStartCell(); + } } diff --git a/src/ModelUpload.php b/src/ModelUpload.php index 4eb57f8..7952ee6 100755 --- a/src/ModelUpload.php +++ b/src/ModelUpload.php @@ -12,6 +12,18 @@ final class ModelUpload { + private static string $importStartCell = 'A1'; + + public static function importStartCell(): string + { + return self::$importStartCell; + } + + public static function useImportStartCell(string $importStartCell): void + { + self::$importStartCell = $importStartCell; + } + public static function registerRecordProcessors(array $processors): void { /** @var RecordProcessorManager $manager */