Closed Xinecraft closed 4 years ago
I strongly doubt it. I get points through the "deposit" in automatic mode (crontab), there were no problems. I am logging every point accrual, everything is clear. I would look for a problem in the code.
Hey, Thanks. It seems this issue is not occurring after I updated the version.
But do anyone know why the casting of Wallet "balance" to "int" doesn't work?
/**
* Wallet model configuration.
*/
'wallet' => [
'table' => 'wallets',
'model' => Wallet::class,
'casts' => [
'balance' => 'int'
],
'default' => [
'name' => 'Default Wallet',
'slug' => 'default',
'decimal_places' => 0
],
],
@kinnngg Needed for long arithmetic to work. This is a cardinal difference between the 5th version and the 4th.
https://github.com/bavix/laravel-wallet/blob/master/src/Simple/Math.php
All arithmetic is reduced to a string in order to be able to create wallets of ether, bitcoin and others. A lot of people asked for this functionality.
Ohk. Thanks
Anyone know whats wrong with this code or its there some bug in package?
This is making the wallet go crazy. After running it the wallet amount changes to wierd high for example if a user has 6540 cent and deposit is of 750 cent then wallet bal ($user->balance) will show up 15037 till you run
php artisan wallet:refresh
(this command fixes it)