From 950ef3b585fc9cd684f68e5ab0009e8bfa865135 Mon Sep 17 00:00:00 2001 From: Maximilian Walter Date: Wed, 25 May 2016 22:58:41 +0200 Subject: [PATCH] added: playlist sort by favourite_count on initial request update: added composer lock file to gitignore --- .gitignore | 3 ++- app/Http/Controllers/Api/Web/PlaylistsController.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index deb80874..a9c74a7f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ Homestead.yaml .env .vagrant _ide_helper.php -.idea \ No newline at end of file +.idea +composer.lock diff --git a/app/Http/Controllers/Api/Web/PlaylistsController.php b/app/Http/Controllers/Api/Web/PlaylistsController.php index b86f288e..541a3bba 100644 --- a/app/Http/Controllers/Api/Web/PlaylistsController.php +++ b/app/Http/Controllers/Api/Web/PlaylistsController.php @@ -72,7 +72,7 @@ class PlaylistsController extends ApiControllerBase $query = Playlist::summary() ->with('user', 'user.avatar', 'tracks', 'tracks.cover', 'tracks.user', 'tracks.album', 'tracks.album.user') ->userDetails() - ->orderBy('title', 'asc') + ->orderBy('favourite_count', 'desc') ->where('track_count', '>', 0) ->whereIsPublic(true);