From 04d68905ba228ceaf644c1d70815948a9f972d2a Mon Sep 17 00:00:00 2001 From: Simon Depelchin Date: Thu, 22 Feb 2018 12:12:55 +0100 Subject: [PATCH] Fixing wallet update when balance is updated --- src/HasWallet.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HasWallet.php b/src/HasWallet.php index 6ff7095..7bcf9d3 100644 --- a/src/HasWallet.php +++ b/src/HasWallet.php @@ -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([ @@ -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()