Skip to content

Commit

Permalink
Added combinations to medias gets
Browse files Browse the repository at this point in the history
  • Loading branch information
marioSantos97 committed Oct 28, 2022
1 parent d1601fa commit 2ff8088
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/Models/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public function combinatedMedias()

public function getCombinationsAttribute()
{
return $this->combinatedMedias()->get();
return $this->combinatedMedias()->with('mediaContent')->get();
}
}
2 changes: 1 addition & 1 deletion src/app/Models/Traits/MediaTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function getMedia($column, $mediaFieldId = false)

$orderedIds = array_values($mediaIds->toArray());
$mediaContents = MediaContent::whereIn('media_id', $mediaIds)
->with(['media', 'combinatedMedias'])->get();
->with(['media'])->get();

foreach ($mediaContents as $mediaContent) {
foreach ($mediaIds as $position => $mediaId) {
Expand Down

0 comments on commit 2ff8088

Please sign in to comment.