Skip to content

Commit 789868c

Browse files
committed
wip
1 parent 30374bc commit 789868c

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/Http/Livewire/CsvImporter.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,19 @@ protected function importCsv()
123123
$import = $this->createNewImport();
124124
$chunks = (new ChunkIterator($this->csvRecords->getIterator(), 10))->get();
125125

126-
// $jobs = collect($chunks)
127-
// ->map(
128-
// fn ($chunk) => new ImportCsv(
129-
// $import,
130-
// $this->model,
131-
// $chunk,
132-
// $this->columnsToMap
133-
// )
134-
// );
135-
136-
// Bus::batch($jobs)
137-
// ->finally(
138-
// fn () => $import->touch('compoleted_at')
139-
// )->dispatch();
126+
$jobs = collect($chunks)
127+
->map(
128+
fn ($chunk) => new ImportCsv(
129+
$import,
130+
$this->model,
131+
$chunk,
132+
$this->columnsToMap
133+
)
134+
);
135+
136+
Bus::batch($jobs)
137+
->finally(
138+
fn () => $import->touch('compoleted_at')
139+
)->dispatch();
140140
}
141141
}

0 commit comments

Comments
 (0)