@@ -54,6 +54,12 @@ php artisan vendor:publish --tag="pay-pocket-wallets"
54
54
55
55
This command will automatically publish the ` WalletEnums.php ` file into your application's ` app/Enums ` directory.
56
56
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
+
57
63
## Preparation
58
64
59
65
### 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
100
106
101
107
### Deposit
102
108
109
+ ``` php
110
+ deposit(type: 'wallet_1', amount: 123.45, notes: null)
111
+ ```
112
+
113
+ Deposit funds into ` wallet_1 `
114
+
103
115
``` php
104
116
$user = auth()->user();
117
+ $user->deposit('wallet_1', 123.45);
118
+ ```
105
119
106
- $user->deposit('wallet_1', 123.45); // Deposit funds into 'wallet_1'
120
+ Deposit funds into ` wallet_2 `
107
121
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
+ ```
109
126
110
- // Or using provided facade
127
+ Or using provided facade
111
128
129
+ ``` php
112
130
use HPWebdeveloper\LaravelPayPocket\Facades\LaravelPayPocket;
113
131
132
+ $user = auth()->user();
114
133
LaravelPayPocket::deposit($user, 'wallet_1', 123.45);
115
134
116
135
```
@@ -129,16 +148,27 @@ $user->deposit('wallet_1', 67.89, 'You ordered pizza.');
129
148
### Pay
130
149
131
150
``` 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();
133
158
$user->pay(12.34);
159
+ ```
134
160
135
- // Or using provided facade
161
+ Or using provided facade
136
162
163
+ ``` php
137
164
use HPWebdeveloper\LaravelPayPocket\Facades\LaravelPayPocket;
138
165
166
+ $user = auth()->user();
139
167
LaravelPayPocket::pay($user, 12.34);
140
168
```
141
169
170
+ By default the sytem will attempt to pay using all available wallets exept the ` allowedWallets ` param is provided.
171
+
142
172
### Balance
143
173
144
174
- ** Wallets**
@@ -206,3 +236,5 @@ Please review [our security policy](../../security/policy) on how to report secu
206
236
## License
207
237
208
238
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