mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Fix: import job class now resolved from the container.
Previously, following the instructions by binding Filament's ImportJob class to your own subclass didn't work, since the code was newing up a new instance of the job class itself, rather than using the container.
This commit is contained in:
@@ -273,12 +273,12 @@ trait CanImportRecords
|
||||
$import->unsetRelation('user');
|
||||
|
||||
$importJobs = collect($importChunks)
|
||||
->map(fn (array $importChunk): object => new ($job)(
|
||||
$import,
|
||||
rows: base64_encode(serialize($importChunk)),
|
||||
columnMap: $data['columnMap'],
|
||||
options: $options,
|
||||
));
|
||||
->map(fn (array $importChunk): object => app($job, [
|
||||
'import' => $import,
|
||||
'rows' => base64_encode(serialize($importChunk)),
|
||||
'columnMap' => $data['columnMap'],
|
||||
'options' => $options,
|
||||
]));
|
||||
|
||||
$importer = $import->getImporter(
|
||||
columnMap: $data['columnMap'],
|
||||
|
||||
Reference in New Issue
Block a user