Skip to content

Commit 37c2a04

Browse files
committed
Updating README
1 parent 6c2fdbb commit 37c2a04

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

README.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ php artisan vendor:publish --tag="pay-pocket-wallets"
5454

5555
This command will automatically publish the `WalletEnums.php` file into your application's `app/Enums` directory.
5656

57+
## Updating
58+
59+
If updating from version `<= 1.0.3`, new migrations have been added to support the new [Transaction Info Feature](#transaction-info)
60+
61+
Follow the [Installation](#installation) Step 2 to update your migrations.
62+
5763
## Preparation
5864

5965
### Prepare User Model
@@ -100,17 +106,30 @@ If the balance in `wallet_1` is 10 and the balance in `wallet_2` is 20, and you
100106

101107
### Deposit
102108

109+
```php
110+
deposit(type: 'wallet_1', amount: 123.45, notes: null)
111+
```
112+
113+
Deposit funds into `wallet_1`
114+
103115
```php
104116
$user = auth()->user();
117+
$user->deposit('wallet_1', 123.45);
118+
```
105119

106-
$user->deposit('wallet_1', 123.45); // Deposit funds into 'wallet_1'
120+
Deposit funds into `wallet_2`
107121

108-
$user->deposit('wallet_2', 67.89); // Deposit funds into 'wallet_2'
122+
```php
123+
$user = auth()->user();
124+
$user->deposit('wallet_2', 67.89);
125+
```
109126

110-
// Or using provided facade
127+
Or using provided facade
111128

129+
```php
112130
use HPWebdeveloper\LaravelPayPocket\Facades\LaravelPayPocket;
113131

132+
$user = auth()->user();
114133
LaravelPayPocket::deposit($user, 'wallet_1', 123.45);
115134

116135
```
@@ -129,16 +148,27 @@ $user->deposit('wallet_1', 67.89, 'You ordered pizza.');
129148
### Pay
130149

131150
```php
132-
// Pay the value using the total combined balance available across all wallets
151+
pay(amount: 12.34, notes: null)
152+
```
153+
154+
Pay the value using the total combined balance available across all allowed wallets
155+
156+
```php
157+
$user = auth()->user();
133158
$user->pay(12.34);
159+
```
134160

135-
// Or using provided facade
161+
Or using provided facade
136162

163+
```php
137164
use HPWebdeveloper\LaravelPayPocket\Facades\LaravelPayPocket;
138165

166+
$user = auth()->user();
139167
LaravelPayPocket::pay($user, 12.34);
140168
```
141169

170+
By default the sytem will attempt to pay using all available wallets exept the `allowedWallets` param is provided.
171+
142172
### Balance
143173

144174
- **Wallets**
@@ -206,3 +236,5 @@ Please review [our security policy](../../security/policy) on how to report secu
206236
## License
207237

208238
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
239+
240+
[i8]: https://github.com/HPWebdeveloper/laravel-pay-pocket/issues/8

0 commit comments

Comments
 (0)