Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/ModelRecordImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -101,4 +102,9 @@ public function sheets(): array
public function onUnknownSheet($sheetName): void
{
}

public function startCell(): string
{
return ModelUpload::importStartCell();
}
}
12 changes: 12 additions & 0 deletions src/ModelUpload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down