Some foreach loop cleaning up.

This commit is contained in:
James Cole
2015-04-11 12:27:56 +02:00
parent 5c06b45eb1
commit f6999f355b
2 changed files with 9 additions and 46 deletions

View File

@@ -62,12 +62,7 @@ class BillRepository implements BillRepositoryInterface
public function getActiveBills()
{
/** @var Collection $set */
$set = Auth::user()->bills()->orderBy('name', 'ASC')->where('active', 1)->get();
$set->sort(
function (Bill $bill) {
return $bill->name;
}
);
$set = Auth::user()->bills()->orderBy('name', 'ASC')->where('active', 1)->get()->sortBy('name');
return $set;
}
@@ -78,12 +73,7 @@ class BillRepository implements BillRepositoryInterface
public function getBills()
{
/** @var Collection $set */
$set = Auth::user()->bills()->orderBy('name', 'ASC')->get();
$set->sort(
function (Bill $bill) {
return $bill->name;
}
);
$set = Auth::user()->bills()->orderBy('name', 'ASC')->get()->sortBy('name');
return $set;
}