File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace FromHome \ModelUpload ;
6
6
7
+ use Illuminate \Support \Str ;
7
8
use Webmozart \Assert \Assert ;
8
9
use Maatwebsite \Excel \Concerns \ToModel ;
9
10
use Maatwebsite \Excel \Events \AfterImport ;
@@ -62,6 +63,7 @@ public function model(array $row): ModelUploadRecord
62
63
Assert::notNull ($ this ->uploadFile );
63
64
64
65
return new ModelUploadRecord ([
66
+ 'id ' => \strtolower ((string ) Str::ulid ()),
65
67
'model_upload_file_id ' => $ this ->uploadFile ->getKey (),
66
68
'payload ' => $ row ,
67
69
'meta ' => $ this ->meta ,
Original file line number Diff line number Diff line change @@ -17,16 +17,16 @@ public function registerRecordProcessors(array $processors): void
17
17
18
18
public function getRecordProcessor (string $ modelType ): ?ModelUploadRecordProcessor
19
19
{
20
- $ actionClass = $ this ->actions [$ modelType ] ?? null ;
20
+ $ processorClass = $ this ->processors [$ modelType ] ?? null ;
21
21
22
- if ($ actionClass === null ) {
22
+ if ($ processorClass === null ) {
23
23
return null ;
24
24
}
25
25
26
- $ action = app ($ actionClass );
26
+ $ processor = app ($ processorClass );
27
27
28
- Assert::isInstanceOf ($ action , ModelUploadRecordProcessor::class);
28
+ Assert::isInstanceOf ($ processor , ModelUploadRecordProcessor::class);
29
29
30
- return $ action ;
30
+ return $ processor ;
31
31
}
32
32
}
You can’t perform that action at this time.
0 commit comments