diff --git a/app/Exports/Banking/Transactions.php b/app/Exports/Banking/Transactions.php index 5a90bcaba..33eefcda2 100644 --- a/app/Exports/Banking/Transactions.php +++ b/app/Exports/Banking/Transactions.php @@ -9,7 +9,7 @@ class Transactions extends Export { public function collection() { - $model = Model::with(['account', 'bill', 'category', 'contact', 'invoice'])->usingSearchString(request('search')); + $model = Model::with('account', 'bill', 'category', 'contact', 'invoice')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('id', (array) $this->ids); diff --git a/app/Exports/Common/Items.php b/app/Exports/Common/Items.php index a42d103e4..24ed3a51c 100644 --- a/app/Exports/Common/Items.php +++ b/app/Exports/Common/Items.php @@ -9,7 +9,7 @@ class Items extends Export { public function collection() { - $model = Model::with(['category', 'tax'])->usingSearchString(request('search')); + $model = Model::with('category', 'tax')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('id', (array) $this->ids); diff --git a/app/Exports/Purchases/Payments.php b/app/Exports/Purchases/Payments.php index dba57e593..8f4384421 100644 --- a/app/Exports/Purchases/Payments.php +++ b/app/Exports/Purchases/Payments.php @@ -9,7 +9,7 @@ class Payments extends Export { public function collection() { - $model = Model::with(['account', 'bill', 'category', 'contact'])->expense()->usingSearchString(request('search')); + $model = Model::with('account', 'bill', 'category', 'contact')->expense()->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('id', (array) $this->ids); diff --git a/app/Exports/Purchases/Sheets/BillHistories.php b/app/Exports/Purchases/Sheets/BillHistories.php index ce8f3f849..6cf0e2a15 100644 --- a/app/Exports/Purchases/Sheets/BillHistories.php +++ b/app/Exports/Purchases/Sheets/BillHistories.php @@ -9,7 +9,7 @@ class BillHistories extends Export { public function collection() { - $model = Model::with(['bill'])->usingSearchString(request('search')); + $model = Model::with('bill')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('bill_id', (array) $this->ids); diff --git a/app/Exports/Purchases/Sheets/BillItemTaxes.php b/app/Exports/Purchases/Sheets/BillItemTaxes.php index 8c28a1606..33f1f483d 100644 --- a/app/Exports/Purchases/Sheets/BillItemTaxes.php +++ b/app/Exports/Purchases/Sheets/BillItemTaxes.php @@ -9,7 +9,7 @@ class BillItemTaxes extends Export { public function collection() { - $model = Model::with(['bill', 'item', 'tax'])->usingSearchString(request('search')); + $model = Model::with('bill', 'item', 'tax')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('bill_id', (array) $this->ids); diff --git a/app/Exports/Purchases/Sheets/BillItems.php b/app/Exports/Purchases/Sheets/BillItems.php index d03370d80..232a18c92 100644 --- a/app/Exports/Purchases/Sheets/BillItems.php +++ b/app/Exports/Purchases/Sheets/BillItems.php @@ -9,7 +9,7 @@ class BillItems extends Export { public function collection() { - $model = Model::with(['bill', 'item'])->usingSearchString(request('search')); + $model = Model::with('bill', 'item')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('bill_id', (array) $this->ids); diff --git a/app/Exports/Purchases/Sheets/BillTotals.php b/app/Exports/Purchases/Sheets/BillTotals.php index b172a7b73..0dbbba030 100644 --- a/app/Exports/Purchases/Sheets/BillTotals.php +++ b/app/Exports/Purchases/Sheets/BillTotals.php @@ -9,7 +9,7 @@ class BillTotals extends Export { public function collection() { - $model = Model::with(['bill'])->usingSearchString(request('search')); + $model = Model::with('bill')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('bill_id', (array) $this->ids); diff --git a/app/Exports/Purchases/Sheets/BillTransactions.php b/app/Exports/Purchases/Sheets/BillTransactions.php index 40af135a9..148bcec8c 100644 --- a/app/Exports/Purchases/Sheets/BillTransactions.php +++ b/app/Exports/Purchases/Sheets/BillTransactions.php @@ -9,7 +9,7 @@ class BillTransactions extends Export { public function collection() { - $model = Model::with(['account', 'category', 'contact', 'bill'])->expense()->isDocument()->usingSearchString(request('search')); + $model = Model::with('account', 'category', 'contact', 'bill')->expense()->isDocument()->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('document_id', (array) $this->ids); diff --git a/app/Exports/Purchases/Sheets/Bills.php b/app/Exports/Purchases/Sheets/Bills.php index 6d911fef3..670c9e2d3 100644 --- a/app/Exports/Purchases/Sheets/Bills.php +++ b/app/Exports/Purchases/Sheets/Bills.php @@ -9,7 +9,7 @@ class Bills extends Export { public function collection() { - $model = Model::with(['category'])->usingSearchString(request('search')); + $model = Model::with('category')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('id', (array) $this->ids); diff --git a/app/Exports/Sales/Revenues.php b/app/Exports/Sales/Revenues.php index edf74c71b..f03d7c8f5 100644 --- a/app/Exports/Sales/Revenues.php +++ b/app/Exports/Sales/Revenues.php @@ -9,7 +9,7 @@ class Revenues extends Export { public function collection() { - $model = Model::with(['account', 'category', 'contact', 'invoice'])->income()->usingSearchString(request('search')); + $model = Model::with('account', 'category', 'contact', 'invoice')->income()->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('id', (array) $this->ids); diff --git a/app/Exports/Sales/Sheets/InvoiceHistories.php b/app/Exports/Sales/Sheets/InvoiceHistories.php index 47c6186d5..97c3df9f8 100644 --- a/app/Exports/Sales/Sheets/InvoiceHistories.php +++ b/app/Exports/Sales/Sheets/InvoiceHistories.php @@ -9,7 +9,7 @@ class InvoiceHistories extends Export { public function collection() { - $model = Model::with(['invoice'])->usingSearchString(request('search')); + $model = Model::with('invoice')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('invoice_id', (array) $this->ids); diff --git a/app/Exports/Sales/Sheets/InvoiceItemTaxes.php b/app/Exports/Sales/Sheets/InvoiceItemTaxes.php index 99aac016d..04915afcb 100644 --- a/app/Exports/Sales/Sheets/InvoiceItemTaxes.php +++ b/app/Exports/Sales/Sheets/InvoiceItemTaxes.php @@ -9,7 +9,7 @@ class InvoiceItemTaxes extends Export { public function collection() { - $model = Model::with(['invoice', 'item', 'tax'])->usingSearchString(request('search')); + $model = Model::with('invoice', 'item', 'tax')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('invoice_id', (array) $this->ids); diff --git a/app/Exports/Sales/Sheets/InvoiceItems.php b/app/Exports/Sales/Sheets/InvoiceItems.php index 1379c704b..233272014 100644 --- a/app/Exports/Sales/Sheets/InvoiceItems.php +++ b/app/Exports/Sales/Sheets/InvoiceItems.php @@ -9,7 +9,7 @@ class InvoiceItems extends Export { public function collection() { - $model = Model::with(['invoice', 'item'])->usingSearchString(request('search')); + $model = Model::with('invoice', 'item')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('invoice_id', (array) $this->ids); diff --git a/app/Exports/Sales/Sheets/InvoiceTotals.php b/app/Exports/Sales/Sheets/InvoiceTotals.php index c640b144a..3ca816580 100644 --- a/app/Exports/Sales/Sheets/InvoiceTotals.php +++ b/app/Exports/Sales/Sheets/InvoiceTotals.php @@ -9,7 +9,7 @@ class InvoiceTotals extends Export { public function collection() { - $model = Model::with(['invoice'])->usingSearchString(request('search')); + $model = Model::with('invoice')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('invoice_id', (array) $this->ids); diff --git a/app/Exports/Sales/Sheets/InvoiceTransactions.php b/app/Exports/Sales/Sheets/InvoiceTransactions.php index 2855d8f06..70116248f 100644 --- a/app/Exports/Sales/Sheets/InvoiceTransactions.php +++ b/app/Exports/Sales/Sheets/InvoiceTransactions.php @@ -9,7 +9,7 @@ class InvoiceTransactions extends Export { public function collection() { - $model = Model::with(['account', 'category', 'contact', 'invoice'])->income()->isDocument()->usingSearchString(request('search')); + $model = Model::with('account', 'category', 'contact', 'invoice')->income()->isDocument()->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('document_id', (array) $this->ids); diff --git a/app/Exports/Sales/Sheets/Invoices.php b/app/Exports/Sales/Sheets/Invoices.php index 20ad0c4d3..4e006731e 100644 --- a/app/Exports/Sales/Sheets/Invoices.php +++ b/app/Exports/Sales/Sheets/Invoices.php @@ -9,7 +9,7 @@ class Invoices extends Export { public function collection() { - $model = Model::with(['category'])->usingSearchString(request('search')); + $model = Model::with('category')->usingSearchString(request('search')); if (!empty($this->ids)) { $model->whereIn('id', (array) $this->ids); diff --git a/app/Http/Controllers/Api/Auth/Users.php b/app/Http/Controllers/Api/Auth/Users.php index e384fec8b..47b31b75f 100644 --- a/app/Http/Controllers/Api/Auth/Users.php +++ b/app/Http/Controllers/Api/Auth/Users.php @@ -19,7 +19,7 @@ class Users extends ApiController */ public function index() { - $users = User::with(['companies', 'roles', 'permissions'])->collect(); + $users = User::with('companies', 'permissions', 'roles')->collect(); return $this->response->paginator($users, new Transformer()); } @@ -34,9 +34,9 @@ class Users extends ApiController { // Check if we're querying by id or email if (is_numeric($id)) { - $user = User::with(['companies', 'roles', 'permissions'])->find($id); + $user = User::with('companies', 'permissions', 'roles')->find($id); } else { - $user = User::with(['companies', 'roles', 'permissions'])->where('email', $id)->first(); + $user = User::with('companies', 'permissions', 'roles')->where('email', $id)->first(); } return $this->response->item($user, new Transformer()); diff --git a/app/Http/Controllers/Api/Banking/Reconciliations.php b/app/Http/Controllers/Api/Banking/Reconciliations.php index 51a5fb517..56a5e91f2 100644 --- a/app/Http/Controllers/Api/Banking/Reconciliations.php +++ b/app/Http/Controllers/Api/Banking/Reconciliations.php @@ -19,7 +19,7 @@ class Reconciliations extends ApiController */ public function index() { - $items = Reconciliation::with(['account'])->collect(); + $items = Reconciliation::with('account')->collect(); return $this->response->paginator($items, new Transformer()); } diff --git a/app/Http/Controllers/Api/Banking/Transactions.php b/app/Http/Controllers/Api/Banking/Transactions.php index 6b4d0321e..61dcbbe54 100644 --- a/app/Http/Controllers/Api/Banking/Transactions.php +++ b/app/Http/Controllers/Api/Banking/Transactions.php @@ -19,7 +19,7 @@ class Transactions extends ApiController */ public function index() { - $transactions = Transaction::with(['account', 'category', 'contact'])->collect(['paid_at'=> 'desc']); + $transactions = Transaction::with('account', 'category', 'contact')->collect(['paid_at'=> 'desc']); return $this->response->paginator($transactions, new Transformer()); } diff --git a/app/Http/Controllers/Api/Banking/Transfers.php b/app/Http/Controllers/Api/Banking/Transfers.php index bed2f4bd3..959c94c93 100644 --- a/app/Http/Controllers/Api/Banking/Transfers.php +++ b/app/Http/Controllers/Api/Banking/Transfers.php @@ -19,9 +19,9 @@ class Transfers extends ApiController */ public function index() { - $transfers = Transfer::with([ + $transfers = Transfer::with( 'expense_transaction', 'expense_transaction.account', 'income_transaction', 'income_transaction.account' - ])->collect('expense_transaction.paid_at'); + )->collect('expense_transaction.paid_at'); $special_key = [ 'expense_transaction.name' => 'from_account', diff --git a/app/Http/Controllers/Api/Common/Items.php b/app/Http/Controllers/Api/Common/Items.php index f2fefeadd..60f4f89b1 100644 --- a/app/Http/Controllers/Api/Common/Items.php +++ b/app/Http/Controllers/Api/Common/Items.php @@ -22,7 +22,7 @@ class Items extends ApiController */ public function index() { - $items = Item::with(['category', 'tax'])->collect(); + $items = Item::with('category', 'tax')->collect(); return $this->response->paginator($items, new Transformer()); } @@ -35,7 +35,7 @@ class Items extends ApiController */ public function show($id) { - $item = Item::with(['category', 'tax'])->find($id); + $item = Item::with('category', 'tax')->find($id); return $this->response->item($item, new Transformer()); } diff --git a/app/Http/Controllers/Api/Purchases/Bills.php b/app/Http/Controllers/Api/Purchases/Bills.php index 1cdb98c9d..3eb4b5aa1 100644 --- a/app/Http/Controllers/Api/Purchases/Bills.php +++ b/app/Http/Controllers/Api/Purchases/Bills.php @@ -19,7 +19,7 @@ class Bills extends ApiController */ public function index() { - $bills = Bill::with(['contact', 'items', 'transactions', 'histories'])->collect(['billed_at'=> 'desc']); + $bills = Bill::with('contact', 'histories', 'items', 'transactions')->collect(['billed_at'=> 'desc']); return $this->response->paginator($bills, new Transformer()); } diff --git a/app/Http/Controllers/Api/Sales/Invoices.php b/app/Http/Controllers/Api/Sales/Invoices.php index 1c46d4b44..3da1d3329 100644 --- a/app/Http/Controllers/Api/Sales/Invoices.php +++ b/app/Http/Controllers/Api/Sales/Invoices.php @@ -19,7 +19,7 @@ class Invoices extends ApiController */ public function index() { - $invoices = Invoice::with(['contact', 'items', 'transactions', 'histories'])->collect(['invoiced_at'=> 'desc']); + $invoices = Invoice::with('contact', 'histories', 'items', 'transactions')->collect(['invoiced_at'=> 'desc']); return $this->response->paginator($invoices, new Transformer()); } diff --git a/app/Http/Controllers/Auth/Users.php b/app/Http/Controllers/Auth/Users.php index 5f62ae6dd..f68cb3603 100644 --- a/app/Http/Controllers/Auth/Users.php +++ b/app/Http/Controllers/Auth/Users.php @@ -23,7 +23,7 @@ class Users extends Controller */ public function index() { - $users = User::with(['media', 'roles'])->collect(); + $users = User::with('media', 'roles')->collect(); return view('auth.users.index', compact('users')); } diff --git a/app/Http/Controllers/Banking/Transactions.php b/app/Http/Controllers/Banking/Transactions.php index fe23cae88..7cfeded9c 100644 --- a/app/Http/Controllers/Banking/Transactions.php +++ b/app/Http/Controllers/Banking/Transactions.php @@ -28,7 +28,7 @@ class Transactions extends Controller $request_type = !request()->has('type') ? ['income', 'expense'] : request('type'); $categories = Category::enabled()->type($request_type)->orderBy('name')->pluck('name', 'id'); - $transactions = Transaction::with(['account', 'category', 'contact'])->collect(['paid_at'=> 'desc']); + $transactions = Transaction::with('account', 'category', 'contact')->collect(['paid_at'=> 'desc']); return view('banking.transactions.index', compact('transactions', 'accounts', 'types', 'categories')); } diff --git a/app/Http/Controllers/Banking/Transfers.php b/app/Http/Controllers/Banking/Transfers.php index ed92b5201..58cc85b32 100644 --- a/app/Http/Controllers/Banking/Transfers.php +++ b/app/Http/Controllers/Banking/Transfers.php @@ -24,9 +24,9 @@ class Transfers extends Controller { $data = []; - $items = Transfer::with([ + $items = Transfer::with( 'expense_transaction', 'expense_transaction.account', 'income_transaction', 'income_transaction.account' - ])->collect(['expense_transaction.paid_at' => 'desc']); + )->collect(['expense_transaction.paid_at' => 'desc']); foreach ($items as $item) { $income_transaction = $item->income_transaction; diff --git a/app/Http/Controllers/Common/Items.php b/app/Http/Controllers/Common/Items.php index e435526f8..36a47306a 100644 --- a/app/Http/Controllers/Common/Items.php +++ b/app/Http/Controllers/Common/Items.php @@ -28,7 +28,7 @@ class Items extends Controller */ public function index() { - $items = Item::with(['category', 'media'])->collect(); + $items = Item::with('category', 'media')->collect(); return view('common.items.index', compact('items')); } diff --git a/app/Http/Controllers/Portal/Invoices.php b/app/Http/Controllers/Portal/Invoices.php index a843bb564..b3ea45aeb 100644 --- a/app/Http/Controllers/Portal/Invoices.php +++ b/app/Http/Controllers/Portal/Invoices.php @@ -23,7 +23,7 @@ class Invoices extends Controller */ public function index() { - $invoices = Invoice::with(['contact', 'items', 'payments', 'histories']) + $invoices = Invoice::with('contact', 'histories', 'items', 'payments') ->accrued()->where('contact_id', user()->contact->id) ->collect(['invoice_number'=> 'desc']); diff --git a/app/Http/Controllers/Purchases/Bills.php b/app/Http/Controllers/Purchases/Bills.php index 3e73b2905..43d1bda0e 100644 --- a/app/Http/Controllers/Purchases/Bills.php +++ b/app/Http/Controllers/Purchases/Bills.php @@ -37,7 +37,7 @@ class Bills extends Controller */ public function index() { - $bills = Bill::with(['contact', 'transactions'])->collect(['billed_at'=> 'desc']); + $bills = Bill::with('contact', 'transactions')->collect(['billed_at'=> 'desc']); $vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id'); diff --git a/app/Http/Controllers/Purchases/Payments.php b/app/Http/Controllers/Purchases/Payments.php index 2f0217788..e49d77f85 100644 --- a/app/Http/Controllers/Purchases/Payments.php +++ b/app/Http/Controllers/Purchases/Payments.php @@ -30,7 +30,7 @@ class Payments extends Controller */ public function index() { - $payments = Transaction::with(['account', 'bill', 'category', 'contact'])->expense()->isNotTransfer()->collect(['paid_at'=> 'desc']); + $payments = Transaction::with('account', 'bill', 'category', 'contact')->expense()->isNotTransfer()->collect(['paid_at'=> 'desc']); $vendors = Contact::vendor()->enabled()->orderBy('name')->pluck('name', 'id'); diff --git a/app/Http/Controllers/Sales/Invoices.php b/app/Http/Controllers/Sales/Invoices.php index 9a68433fb..bd2d6e131 100644 --- a/app/Http/Controllers/Sales/Invoices.php +++ b/app/Http/Controllers/Sales/Invoices.php @@ -38,7 +38,7 @@ class Invoices extends Controller */ public function index() { - $invoices = Invoice::with(['contact', 'transactions'])->collect(['invoice_number'=> 'desc']); + $invoices = Invoice::with('contact', 'transactions')->collect(['invoice_number'=> 'desc']); $customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id'); diff --git a/app/Http/Controllers/Sales/Revenues.php b/app/Http/Controllers/Sales/Revenues.php index 22986bc99..14212e8f2 100644 --- a/app/Http/Controllers/Sales/Revenues.php +++ b/app/Http/Controllers/Sales/Revenues.php @@ -30,7 +30,7 @@ class Revenues extends Controller */ public function index() { - $revenues = Transaction::with(['account', 'category', 'contact', 'invoice'])->income()->isNotTransfer()->collect(['paid_at'=> 'desc']); + $revenues = Transaction::with('account', 'category', 'contact', 'invoice')->income()->isNotTransfer()->collect(['paid_at'=> 'desc']); $customers = Contact::customer()->enabled()->orderBy('name')->pluck('name', 'id'); diff --git a/app/Reports/ExpenseSummary.php b/app/Reports/ExpenseSummary.php index ac1a8e1c2..593aafb60 100644 --- a/app/Reports/ExpenseSummary.php +++ b/app/Reports/ExpenseSummary.php @@ -41,7 +41,7 @@ class ExpenseSummary extends Report break; default: // Bills - $bills = $this->applyFilters(Bill::with(['recurring', 'transactions'])->accrued(), ['date_field' => 'billed_at'])->get(); + $bills = $this->applyFilters(Bill::with('recurring', 'transactions')->accrued(), ['date_field' => 'billed_at'])->get(); Recurring::reflect($bills, 'billed_at'); $this->setTotals($bills, 'billed_at'); diff --git a/app/Reports/IncomeExpenseSummary.php b/app/Reports/IncomeExpenseSummary.php index 149c2c31a..1cc9a0dd3 100644 --- a/app/Reports/IncomeExpenseSummary.php +++ b/app/Reports/IncomeExpenseSummary.php @@ -32,7 +32,7 @@ class IncomeExpenseSummary extends Report break; default: // Invoices - $invoices = $this->applyFilters(Invoice::with(['recurring', 'transactions'])->accrued(), ['date_field' => 'invoiced_at'])->get(); + $invoices = $this->applyFilters(Invoice::with('recurring', 'transactions')->accrued(), ['date_field' => 'invoiced_at'])->get(); Recurring::reflect($invoices, 'invoiced_at'); $this->setTotals($invoices, 'invoiced_at', true); @@ -42,7 +42,7 @@ class IncomeExpenseSummary extends Report $this->setTotals($revenues, 'paid_at', true); // Bills - $bills = $this->applyFilters(Bill::with(['recurring', 'transactions'])->accrued(), ['date_field' => 'billed_at'])->get(); + $bills = $this->applyFilters(Bill::with('recurring', 'transactions')->accrued(), ['date_field' => 'billed_at'])->get(); Recurring::reflect($bills, 'bill', 'billed_at'); $this->setTotals($bills, 'billed_at', true); diff --git a/app/Reports/IncomeSummary.php b/app/Reports/IncomeSummary.php index 4f8b2f513..b2cd467f4 100644 --- a/app/Reports/IncomeSummary.php +++ b/app/Reports/IncomeSummary.php @@ -41,7 +41,7 @@ class IncomeSummary extends Report break; default: // Invoices - $invoices = $this->applyFilters(Invoice::with(['recurring', 'transactions'])->accrued(), ['date_field' => 'invoiced_at'])->get(); + $invoices = $this->applyFilters(Invoice::with('recurring', 'transactions')->accrued(), ['date_field' => 'invoiced_at'])->get(); Recurring::reflect($invoices, 'invoiced_at'); $this->setTotals($invoices, 'invoiced_at'); diff --git a/app/Reports/ProfitLoss.php b/app/Reports/ProfitLoss.php index 3365ec3db..9d12c5a47 100644 --- a/app/Reports/ProfitLoss.php +++ b/app/Reports/ProfitLoss.php @@ -51,7 +51,7 @@ class ProfitLoss extends Report break; default: // Invoices - $invoices = $this->applyFilters(Invoice::with(['recurring', 'transactions', 'totals'])->accrued(), ['date_field' => 'invoiced_at'])->get(); + $invoices = $this->applyFilters(Invoice::with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'invoiced_at'])->get(); Recurring::reflect($invoices, 'invoiced_at'); $this->setTotals($invoices, 'invoiced_at', true, $this->tables['income'], false); @@ -61,7 +61,7 @@ class ProfitLoss extends Report $this->setTotals($revenues, 'paid_at', true, $this->tables['income'], false); // Bills - $bills = $this->applyFilters(Bill::with(['recurring', 'transactions', 'totals'])->accrued(), ['date_field' => 'billed_at'])->get(); + $bills = $this->applyFilters(Bill::with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'billed_at'])->get(); Recurring::reflect($bills, 'bill', 'billed_at'); $this->setTotals($bills, 'billed_at', true, $this->tables['expense'], false); diff --git a/app/Reports/TaxSummary.php b/app/Reports/TaxSummary.php index f9f62123a..7dc576e0e 100644 --- a/app/Reports/TaxSummary.php +++ b/app/Reports/TaxSummary.php @@ -42,22 +42,22 @@ class TaxSummary extends Report switch ($this->model->settings->basis) { case 'cash': // Invoice Payments - $invoices = $this->applyFilters(Transaction::with(['recurring', 'invoice', 'invoice.totals'])->income()->isDocument()->isNotTransfer(), ['date_field' => 'paid_at'])->get(); + $invoices = $this->applyFilters(Transaction::with('recurring', 'invoice', 'invoice.totals')->income()->isDocument()->isNotTransfer(), ['date_field' => 'paid_at'])->get(); $this->setTotals($invoices, 'paid_at'); // Bill Payments - $bills = $this->applyFilters(Transaction::with(['recurring', 'bill', 'bill.totals'])->expense()->isDocument()->isNotTransfer(), ['date_field' => 'paid_at'])->get(); + $bills = $this->applyFilters(Transaction::with('recurring', 'bill', 'bill.totals')->expense()->isDocument()->isNotTransfer(), ['date_field' => 'paid_at'])->get(); $this->setTotals($bills, 'paid_at'); break; default: // Invoices - $invoices = $this->applyFilters(Invoice::with(['recurring', 'transactions', 'totals'])->accrued(), ['date_field' => 'invoiced_at'])->get(); + $invoices = $this->applyFilters(Invoice::with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'invoiced_at'])->get(); Recurring::reflect($invoices, 'invoiced_at'); $this->setTotals($invoices, 'invoiced_at'); // Bills - $bills = $this->applyFilters(Bill::with(['recurring', 'transactions', 'totals'])->accrued(), ['date_field' => 'billed_at'])->get(); + $bills = $this->applyFilters(Bill::with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'billed_at'])->get(); Recurring::reflect($bills, 'billed_at'); $this->setTotals($bills, 'billed_at'); diff --git a/app/Widgets/AccountBalance.php b/app/Widgets/AccountBalance.php index cea44d4ef..54822ae64 100644 --- a/app/Widgets/AccountBalance.php +++ b/app/Widgets/AccountBalance.php @@ -11,7 +11,7 @@ class AccountBalance extends Widget public function show() { - $accounts = Account::with(['income_transactions', 'expense_transactions'])->enabled()->take(5)->get(); + $accounts = Account::with('income_transactions', 'expense_transactions')->enabled()->take(5)->get(); return $this->view('widgets.account_balance', [ 'accounts' => $accounts,