From 543cc5a846d9cb7a583aaf4f520b8d352575fc85 Mon Sep 17 00:00:00 2001 From: Mike Scott Date: Sat, 25 May 2024 18:11:55 +0100 Subject: [PATCH] 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. --- packages/actions/src/Concerns/CanImportRecords.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/actions/src/Concerns/CanImportRecords.php b/packages/actions/src/Concerns/CanImportRecords.php index 7563657078..56dcf32e70 100644 --- a/packages/actions/src/Concerns/CanImportRecords.php +++ b/packages/actions/src/Concerns/CanImportRecords.php @@ -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'],