auth->user()) ->where('albums.id', $id) ->first(); } /** @return Collection|array */ public function getRecentlyAdded(int $count = 6, ?User $scopedUser = null): Collection { return Album::withMeta($scopedUser ?? $this->auth->user()) ->isStandard() ->latest('albums.created_at') ->limit($count) ->get(); } /** @return Collection|array */ public function getMostPlayed(int $count = 6, ?User $scopedUser = null): Collection { $scopedUser ??= $this->auth->user(); return Album::withMeta($scopedUser ?? $this->auth->user()) ->isStandard() ->orderByDesc('play_count') ->limit($count) ->get(); } /** @return Collection|array */ public function getByIds(array $ids, ?User $scopedUser = null): Collection { return Album::withMeta($scopedUser ?? $this->auth->user()) ->whereIn('albums.id', $ids) ->get(); } }