File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 44
55namespace FromHome \ModelUpload ;
66
7+ use Illuminate \Support \Str ;
78use Webmozart \Assert \Assert ;
89use Maatwebsite \Excel \Concerns \ToModel ;
910use Maatwebsite \Excel \Events \AfterImport ;
@@ -62,6 +63,7 @@ public function model(array $row): ModelUploadRecord
6263 Assert::notNull ($ this ->uploadFile );
6364
6465 return new ModelUploadRecord ([
66+ 'id ' => \strtolower ((string ) Str::ulid ()),
6567 'model_upload_file_id ' => $ this ->uploadFile ->getKey (),
6668 'payload ' => $ row ,
6769 'meta ' => $ this ->meta ,
Original file line number Diff line number Diff line change @@ -17,16 +17,16 @@ public function registerRecordProcessors(array $processors): void
1717
1818 public function getRecordProcessor (string $ modelType ): ?ModelUploadRecordProcessor
1919 {
20- $ actionClass = $ this ->actions [$ modelType ] ?? null ;
20+ $ processorClass = $ this ->processors [$ modelType ] ?? null ;
2121
22- if ($ actionClass === null ) {
22+ if ($ processorClass === null ) {
2323 return null ;
2424 }
2525
26- $ action = app ($ actionClass );
26+ $ processor = app ($ processorClass );
2727
28- Assert::isInstanceOf ($ action , ModelUploadRecordProcessor::class);
28+ Assert::isInstanceOf ($ processor , ModelUploadRecordProcessor::class);
2929
30- return $ action ;
30+ return $ processor ;
3131 }
3232}
You can’t perform that action at this time.
0 commit comments