Skip to content

Commit 636b145

Browse files
committed
improve media
1 parent 0dc1fd8 commit 636b145

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/media/src/Console/Commands/InstallCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function publishMigrations(): void
8888
{
8989
if (confirm('Do you wish to publish the migrations?', true)) {
9090
if (Schema::hasTable('media')) {
91-
warning('The media table already exists. The migrations will not be published.');
91+
warning('The media tables already exists. The migrations will not be published.');
9292

9393
return;
9494
}

packages/media/src/Resources/MediaResource/Pages/ListMedia.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)