Closed khanhnam99 closed 5 years ago
Give me more data. Nothing is clear.
$first = User::first(); $last = User::orderBy('id', 'desc')->first(); // last user $first->getKey() !== $last->getKey(); // true
$first->transfer($last, 5); $first->balance; // int(95) $last->balance; // int(5)
how add fee = 10 in $first->transfer($last, 5)
how use function fee()
@khanhnam99 Taxes, commissions, I did not describe in the documentation. But you can learn an example from unit tests. https://github.com/bavix/laravel-wallet/blob/master/tests/TaxTest.php
Model Item: https://github.com/bavix/laravel-wallet/blob/master/tests/Models/ItemTax.php
The tax consists of a percentage and there is no minimum payment. That is, to set a commission of 10 will not work.
thanks
@khanhnam99 in the next version I will add the ability to fix the minimum fee.
the interface will be like this: https://github.com/bavix/laravel-wallet/blob/3.1/src/Interfaces/MinimalTaxable.php#L10
Here is an example of working from a unit test. https://github.com/bavix/laravel-wallet/blob/3.1/tests/MinTaxTest.php
PS, Version 3.1 is in development and is not stable. Do not use in production.
how insert from table transfers , have column fee = 10?