mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Some foreach loop cleaning up.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user