File tree 3 files changed +15
-1
lines changed
3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to ` laravel-balance ` will be documented in this file
4
4
5
+ ## 1.0.2 - 2021-03-26
6
+
7
+ - Added new accesor to get the balance amount transformed to currency.
8
+
5
9
## 1.0.0 - 2021-03-19
6
10
7
11
- initial release
Original file line number Diff line number Diff line change @@ -30,6 +30,16 @@ public function __construct(array $attributes = [])
30
30
$ this ->setTable (config ('balance.table ' , 'balance_history ' ));
31
31
}
32
32
33
+ /**
34
+ * Get the balance amount transformed to currency.
35
+ *
36
+ * @return float|int
37
+ */
38
+ public function getAmountAttribute ()
39
+ {
40
+ return $ this ->attributes ['amount ' ] / 100 ;
41
+ }
42
+
33
43
/**
34
44
* Get the parent of the balance record.
35
45
*
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ trait HasBalance
9
9
/**
10
10
* Get the model's balance amount.
11
11
*
12
- * @return int
12
+ * @return float| int
13
13
*/
14
14
public function getBalanceAttribute ()
15
15
{
You can’t perform that action at this time.
0 commit comments