From b2743825ca39d94fe6a6556935f0e46b3033c210 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 14 Dec 2016 18:44:56 +0100 Subject: [PATCH] Sort account list by name [skip ci] --- app/Support/Binder/AccountList.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Support/Binder/AccountList.php b/app/Support/Binder/AccountList.php index 1512f0bbfa..da684a089f 100644 --- a/app/Support/Binder/AccountList.php +++ b/app/Support/Binder/AccountList.php @@ -47,6 +47,12 @@ class AccountList implements BinderInterface ->where('user_id', auth()->user()->id) ->get(['accounts.*']); if ($object->count() > 0) { + $object = $object->sortBy( + function (Account $account) { + return $account->name; + } + ); + return $object; } }