Commit 9b199953 authored by Antoine Le Gonidec's avatar Antoine Le Gonidec

Improve Game::getCollection output format

parent 448d29b1
......@@ -201,12 +201,12 @@ class Game extends Model {
'screenshot' => $screenshot,
'thumbnail' => $thumbnail,
];
$collection = self::where('game_id', $game_id)->get();
$collection->each(function ($item) {
$item->makeHidden('images');
$games = self::where('game_id', $game_id)->get();
$games->each(function ($game) {
$game->makeHidden('images');
});
$array = $collection->toArray();
$array['images'] = $images;
return $array;
$collection['games'] = $games;
$collection['images'] = $images;
return $collection;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment