@@ -32,7 +32,7 @@ public function getHeaderActions(): array
3232 ->label (__ ('media::fields.collection ' ))
3333 ->options (function () {
3434 return MediaCollection::query ()
35- ->pluck ('name ' , 'id ' )
35+ ->pluck ('name ' , 'name ' )
3636 ->toArray ();
3737 })
3838 ->searchable ()
@@ -41,7 +41,7 @@ public function getHeaderActions(): array
4141 ['name ' => __ ('media::fields.uncategorized ' )],
4242 ['description ' => __ ('media::fields.uncategorized_description ' )]
4343 );
44- return $ collection ->id ;
44+ return $ collection ->name ;
4545 })
4646 ->required ()
4747 ->live (),
@@ -78,7 +78,7 @@ public function getHeaderActions(): array
7878 }
7979
8080 $ processedFiles = session ('processed_files ' , []);
81- $ collection = $ get ('collection_name ' ) ?? ' default ' ;
81+ $ collectionName = $ get ('collection_name ' ) ?? __ ( ' media::fields.uncategorized ' ) ;
8282
8383 foreach ($ state as $ key => $ tempFile ) {
8484 if (in_array ($ key , $ processedFiles )) {
@@ -111,7 +111,7 @@ public function getHeaderActions(): array
111111 $ model ->exists = true ;
112112
113113 $ fileAdder = app (FileAdderFactory::class)->create ($ model , $ tempFile );
114- $ media = $ fileAdder ->preservingOriginal ()->toMediaCollection ($ collection );
114+ $ media = $ fileAdder ->preservingOriginal ()->toMediaCollection ($ collectionName );
115115
116116 $ title = pathinfo ($ tempFile ->getClientOriginalName (), PATHINFO_FILENAME );
117117
0 commit comments