Skip to content

Commit

Permalink
Deleting company fixed transaction object issue..
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jan 14, 2022
1 parent 2050831 commit c68d8b2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Observers/Transaction.php
Expand Up @@ -33,6 +33,10 @@ protected function updateInvoice($transaction)
{
$invoice = $transaction->invoice;

if (empty($invoice)) {
return;
}

$invoice->transactions_count = $invoice->transactions->count();
event(new TransactionsCounted($invoice));

Expand All @@ -49,6 +53,10 @@ protected function updateBill($transaction)
{
$bill = $transaction->bill;

if (empty($bill)) {
return;
}

$bill->transactions_count = $bill->transactions->count();
event(new TransactionsCounted($bill));

Expand Down

0 comments on commit c68d8b2

Please sign in to comment.