Skip to content

Commit

Permalink
docs: move configuration details to separate file
Browse files Browse the repository at this point in the history
Signed-off-by: Kekeocha Justin Chetachukwu <[email protected]>
  • Loading branch information
justinkekeocha authored Sep 14, 2023
1 parent e7b09da commit 325ff25
Showing 1 changed file with 1 addition and 40 deletions.
41 changes: 1 addition & 40 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,4 @@ You can publish the config file with this artisan command:
php artisan vendor:publish --tag=laravel-wallet-config
```

After installing the package, you can proceed to [use it](basic-usage).
## Configure default wallet
You can customize the configuration file to suit certain needs. Example:

Customize `name` and `slug` of default wallet.
```php[config/wallet.php]
'default' => [
'name' => 'Ethereum',
'slug' => 'ETH',
'meta' => [],
],
```
## Extend Wallet class
You can extend the Wallet class by creating a new class that extends `Bavix\Wallet\Models\Wallet` and registering the new class in `config/wallet.php`.
Example `MyWallet.php`

```php[App/Models/MyWallet.php]
use Bavix\Wallet\Models\Wallet as WalletBase;
class MyWallet extends WalletBase {
public function helloWorld(): string { return "hello world"; }
}
```

```php[config/wallet.php]
'wallet' => [
'table' => 'wallets',
'model' => MyWallet::class,
'creating' => [],
'default' => [
'name' => 'Default Wallet',
'slug' => 'default',
'meta' => [],
],
],
```
```php
echo $user->wallet->helloWorld();
```

After installing the package, you can proceed to [use it](basic-usage) or [configure](configuration) it to suit your needs.

0 comments on commit 325ff25

Please sign in to comment.