Skip to content

Commit

Permalink
Expense category n+1 issue solved
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jun 13, 2023
1 parent f44da98 commit 6641803
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Widgets/ExpensesByCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ExpensesByCategory extends Widget

public function show()
{
Category::with('expense_transactions')->expense()->each(function ($category) {
Category::with('expense_transactions')->expense()->withSubCategory()->getWithoutChildren()->each(function ($category) {
$amount = 0;

$this->applyFilters($category->expense_transactions)->each(function ($transaction) use (&$amount) {
Expand Down

0 comments on commit 6641803

Please sign in to comment.