From 325ff2539aa7cc15862759426550eca5fd54b3f6 Mon Sep 17 00:00:00 2001 From: Kekeocha Justin Chetachukwu <39213342+justinkekeocha@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:17:28 +0100 Subject: [PATCH] docs: move configuration details to separate file Signed-off-by: Kekeocha Justin Chetachukwu <39213342+justinkekeocha@users.noreply.github.com> --- docs/installation.md | 41 +---------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 3801c0994..597714145 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -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.