File tree Expand file tree Collapse file tree 9 files changed +66
-8
lines changed Expand file tree Collapse file tree 9 files changed +66
-8
lines changed Original file line number Diff line number Diff line change 1111 - [ Deposit] ( deposit )
1212 - [ Withdraw] ( withdraw )
1313 - [ Transfer] ( transfer )
14- - [ Recalculate balance] ( recalculate )
14+ - [ Refresh balance] ( refresh )
1515
1616- Purchases
1717
Original file line number Diff line number Diff line change 2323 }
2424 </ script >
2525 < script src ="https://unpkg.com/docsify/lib/docsify.min.js "> </ script >
26+ < script src ="https://unpkg.com/prismjs/components/prism-bash.min.js "> </ script >
27+ < script src ="https://unpkg.com/prismjs/components/prism-php.min.js "> </ script >
2628</ body >
2729</ html >
Original file line number Diff line number Diff line change @@ -10,13 +10,17 @@ composer req bavix/laravel-wallet
1010
1111Ensure that you’ve set up your project to [ autoload Composer-installed packages] ( https://getcomposer.org/doc/01-basic-usage.md#autoloading ) .
1212
13- ## Run Migrations
13+ ## You can use it for customization
14+
15+ Sometimes it is useful...
16+
17+ ### Run Migrations
1418Publish the migrations with this artisan command:
1519``` bash
1620php artisan vendor:publish --tag=laravel-wallet-migrations
1721```
1822
19- ## Configuration
23+ ### Configuration
2024You can publish the config file with this artisan command:
2125``` bash
2226php artisan vendor:publish --tag=laravel-wallet-config
Original file line number Diff line number Diff line change 1- # To recalculate the balance
1+ # To refresh the balance
22
33There are situations when you create a lot of unconfirmed operations,
44and then abruptly confirm everything.
55In this case, the user's balance will not change.
6- You must be forced to recalculate the balance.
6+ You must be forced to refresh the balance.
77
88---
99
@@ -42,11 +42,11 @@ where confirmed=0 and
4242-- 212 rows affected in 54 ms
4343```
4444
45- Recalculate the balance.
45+ Refresh the balance.
4646
4747``` php
4848$user->balance; // int(27)
49- $user->wallet->calculateBalance ();
49+ $user->wallet->refreshBalance ();
5050$user->balance; // int(42)
5151```
5252
Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ The following versions of Laravel are supported:
1111- Laravel 5.5
1212- Laravel 5.6
1313- Laravel 5.7
14+ - Laravel 5.8
Original file line number Diff line number Diff line change 1111 - [ Депозит] ( deposit )
1212 - [ Вывод] ( withdraw )
1313 - [ Перевод] ( transfer )
14- - [ Пересчёт баланса] ( recalculate )
14+ - [ Пересчёт баланса] ( refresh )
1515
1616- Покупки
1717
File renamed without changes.
Original file line number Diff line number Diff line change 1111- Laravel 5.5
1212- Laravel 5.6
1313- Laravel 5.7
14+ - Laravel 5.8
Original file line number Diff line number Diff line change 44
55Replace ` ::with('balance') ` to ` ::with('wallet') `
66
7+ ---
8+
79## 2.1.x → 2.2.x
810
911Replace ` CanBePaid ` to ` CanPay ` .
1012
1113Replace ` CanBePaidFloat ` to ` CanPayFloat ` .
14+
15+ ---
16+
17+ ## 2.2.x → 2.4.x
18+
19+ Replace ` calculateBalance ` to ` refreshBalance `
20+
21+ ---
22+
23+ ## 2.4.x → 3.0.x
24+
25+ Replace path ` bavix.wallet::transaction ` to ` Bavix\Wallet\Models\Transaction::class `
26+
27+ Replace path ` bavix.wallet::transfer ` to ` Bavix\Wallet\Models\Transfer::class `
28+
29+ Replace path ` bavix.wallet::wallet ` to ` Bavix\Wallet\Models\Wallet::class `
30+
31+ ``` php
32+ // old
33+ app('bavix.wallet::transaction');
34+ // new
35+ app(Bavix\Wallet\Models\Transaction::class);
36+ ```
37+
38+ Add the ` $quantity ` parameter to the ` canBuy ` method.
39+
40+ ``` php
41+ // old
42+ public function canBuy(Customer $customer, bool $force = false): bool
43+ // new
44+ public function canBuy(Customer $customer, int $quantity = 1, bool $force = null): bool
45+ ```
46+
47+ Add method ` getUniqueId ` to Interface ` Product `
48+
49+ ``` php
50+ class Item extends Model implements Product
51+ {
52+
53+ // Your method
54+
55+ public function getUniqueId(): string
56+ {
57+ return (string)$this->getKey();
58+ }
59+
60+ }
61+ ```
You can’t perform that action at this time.
0 commit comments