Skip to content

Commit

Permalink
docs: changing wallet decimal_places
Browse files Browse the repository at this point in the history
documented how to override wallet decimal_places

Signed-off-by: Kekeocha Justin Chetachukwu <[email protected]>
  • Loading branch information
justinkekeocha authored Oct 6, 2023
1 parent 8fcb209 commit 99c8b4b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,18 @@ class MyWallet extends WalletBase {
echo $user->wallet->helloWorld();
```
This same method above, can be used to extend the base `Transfer` and `Transaction` models and registering the extended models in the configuration file.
### Changing wallet decimal places

You can change the default wallet decimal places, from your extended wallet model by defining a `decimal_places` attribute on the model. This is useful when working with fractional numbers

```php[App/Models/MyWallet.php]
use Bavix\Wallet\Models\Wallet as WalletBase;
class MyWallet extends WalletBase {
protected $attributes = [
'decimal_places' => 18,
];
}
```

0 comments on commit 99c8b4b

Please sign in to comment.