Add imports for facades

This commit is contained in:
James Cole
2025-02-23 12:47:04 +01:00
parent 0086a0ddc8
commit f7ad9c56c8
43 changed files with 132 additions and 94 deletions

View File

@@ -105,11 +105,11 @@ class AccountDestroyService
public function moveTransactions(Account $account, Account $moveTo): void
{
app('log')->debug(sprintf('Move from account #%d to #%d', $account->id, $moveTo->id));
\DB::table('transactions')->where('account_id', $account->id)->update(['account_id' => $moveTo->id]);
DB::table('transactions')->where('account_id', $account->id)->update(['account_id' => $moveTo->id]);
$collection = Transaction::groupBy('transaction_journal_id', 'account_id')
->where('account_id', $moveTo->id)
->get(['transaction_journal_id', 'account_id', \DB::raw('count(*) as the_count')]) // @phpstan-ignore-line
->get(['transaction_journal_id', 'account_id', DB::raw('count(*) as the_count')]) // @phpstan-ignore-line
;
if (0 === $collection->count()) {
return;