Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
69 | public function calculateBalance(): bool |
||
70 | { |
||
71 | $balance = $this->transactions() |
||
72 | ->where('wallet_id', $this->getKey()) |
||
73 | ->where('confirmed', true) |
||
74 | ->sum('amount'); |
||
75 | |||
76 | WalletProxy::set($this->getKey(), $balance); |
||
77 | $this->attributes['balance'] = $balance; |
||
78 | |||
79 | return $this->save(); |
||
80 | } |
||
91 |