Skip to content

Commit

Permalink
Fix media relationship manager (#1794)
Browse files Browse the repository at this point in the history
The media titles and descriptions were broken in the admin panel.
  • Loading branch information
glennjacobs authored May 30, 2024
1 parent c3f5f01 commit e02a255
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ public function table(Table $table): Table
->heading(function () {
$product = $this->getOwnerRecord();

return $product->getMediaCollectionTitle(config('lunar.media.collection')) ?? Str::ucfirst($this->mediaCollection);
return $product->getMediaCollectionTitle($this->mediaCollection) ?? Str::ucfirst($this->mediaCollection);
})
->description(function () {
$product = $this->getOwnerRecord();

return $product->getMediaCollectionDescription(config('lunar.media.collection')) ?? '';
return $product->getMediaCollectionDescription($this->mediaCollection) ?? '';
})
->recordTitleAttribute('name')
->modifyQueryUsing(fn (Builder $query) => $query->where('collection_name', $this->mediaCollection)->orderBy('order_column'))
Expand Down

0 comments on commit e02a255

Please sign in to comment.