Skip to content

Commit

Permalink
Fixing wallet update when balance is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
depsimon committed Feb 22, 2018
1 parent a3c4ace commit 04d6890
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HasWallet.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function canWithdraw($amount)
public function deposit($amount, $type = 'deposit', $meta = [])
{
$this->wallet->balance += $amount;
$this->save();
$this->wallet->save();

$this->wallet->transactions()
->create([
Expand All @@ -72,7 +72,7 @@ public function withdraw($amount, $type = 'withdraw', $meta = [], $shouldAccept

if ($accepted) {
$this->wallet->balance += $amount;
$this->save();
$this->wallet->save();
}

$this->wallet->transactions()
Expand Down

0 comments on commit 04d6890

Please sign in to comment.