Skip to content

Commit

Permalink
Update all custom properties instead of the first one only
Browse files Browse the repository at this point in the history
  • Loading branch information
bkintanar committed Jan 8, 2025
1 parent c38c526 commit 83e37c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Fields/HandlesCustomPropertiesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ private function fillMediaCustomPropertiesFromRequest(NovaRequest $request, Medi
// If we are dealing with nested resources or multiple panels, custom property fields are prefixed.
$key = str_replace($collection, '__media-custom-properties__.'.$collection, $requestAttribute);
$targetAttribute = "custom_properties->{$field->attribute}";
$requestAttribute = "{$key}.{$index}.{$field->attribute}";
$targetRequestAttribute = "{$key}.{$index}.{$field->attribute}";

$field->fillInto($request, $media, $targetAttribute, $requestAttribute);
$field->fillInto($request, $media, $targetAttribute, $targetRequestAttribute);
}

$media->save();
Expand Down

0 comments on commit 83e37c8

Please sign in to comment.