added more db optimizations

This commit is contained in:
nelsonlaquet 2013-08-20 22:02:08 -05:00
parent 21be35a4a9
commit e06e7da234

View file

@ -70,7 +70,7 @@
}
public function getOwned() {
$query = Playlist::summary()->with('pins')->where('user_id', \Auth::user()->id)->orderBy('title', 'asc')->get();
$query = Playlist::summary()->with('pins', 'tracks', 'tracks.cover')->where('user_id', \Auth::user()->id)->orderBy('title', 'asc')->get();
$playlists = [];
foreach ($query as $playlist) {
$playlists[] = [