Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Dec 1, 2024
1 parent beae1d8 commit 8452d60
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Resources/MediaResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ public static function form(Form $form): Form
{
return $form
->schema([
Section::make('Media Details')
Section::make('')
->columns(2)
->schema([
FileUpload::make('media')
->label(__('File(s)'))
->disk(config('media-picker.disk'))
->directory(config('media-picker.directory'))
->shouldPreserveFilename(config('media-picker.should_preserve_filenames'))
->preserveFilenames(config('media-picker.should_preserve_filenames'))
->visibility(config('media-picker.visibility'))
->acceptedFileTypes(config('media-picker.accepted_file_types'))
->required()
Expand All @@ -102,11 +102,11 @@ public static function form(Form $form): Form
->label(__('Model Type'))
->options(function () {
return collect(config('media-picker.file_upload.models'))
->mapWithKeys(fn($model) => [$model => $model::getLabel()])
->mapWithKeys(fn($model) => [$model => class_basename($model)])
->toArray();
})
->columnSpan(1)
->live(), // Add live() to make it reactive
->live(),

Select::make('model_id')
->label(__('Model'))
Expand All @@ -120,7 +120,7 @@ public static function form(Form $form): Form
return $selectedModelType::all()->pluck('name', 'id');
})
->columnSpan(1)
->disabled(fn(Get $get) => ! $get('model_type')), // Disable until model type is selected
->disabled(fn(Get $get) => ! $get('model_type')),
]),
]);
}
Expand Down

0 comments on commit 8452d60

Please sign in to comment.