Skip to content

Commit 04d6890

Browse files
committed
Fixing wallet update when balance is updated
1 parent a3c4ace commit 04d6890

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/HasWallet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function canWithdraw($amount)
4747
public function deposit($amount, $type = 'deposit', $meta = [])
4848
{
4949
$this->wallet->balance += $amount;
50-
$this->save();
50+
$this->wallet->save();
5151

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

7373
if ($accepted) {
7474
$this->wallet->balance += $amount;
75-
$this->save();
75+
$this->wallet->save();
7676
}
7777

7878
$this->wallet->transactions()

0 commit comments

Comments
 (0)