Closed ghost closed 4 years ago
@fatnaydev Hello. I don’t have enough data. Need an example code.
@fatnaydev Hello. I don’t have enough data. Need an example code.
Updated with model and code
The problem is the same when createWallet and then try to forceWithdrawFloat
@fatnaydev This problem does not reproduce.
the strange thing that the system was working well and this week I mark the error but nothing has been moved to the code
@fatnaydev This problem does not reproduce.
@fatnaydev Please tell me which version of laravel you have installed? What version of library (laravel-wallet) are you using?
Depending on the version, see the changes: https://github.com/bavix/laravel-wallet/compare/4.1.2...4.2.0 https://github.com/bavix/laravel-wallet/compare/4.2.0...5.0.0
Laravel 6 Before error 4.2 and then update 5 to view the error gone but not
Another error appear In server show but in my local not
Model Customer are the same
@fatnaydev Please tell me which version of laravel you have installed? What version of library (laravel-wallet) are you using?
Depending on the version, see the changes: 4.1.2...4.2.0 4.2.0...5.0.0
@fatnaydev Use one trait: HasWallet
or HasWaleltFloat
.
@fatnaydev Use one trait:
HasWallet
orHasWaleltFloat
.
Thanks, can share me the file test to run it un my local to test it please
@fatnaydev Unit tests are shared: https://github.com/bavix/laravel-wallet/tree/units/tests
And here is the unit test that I showed: https://github.com/bavix/laravel-wallet/blob/units/tests/MultiWalletTest.php#L93
git clone -b units https://github.com/bavix/laravel-wallet.git
cd laravel-wallet
composer install
./vendor/bin/phpunit
I find the problem, I have 2 models Customer and Prospect, the 2 models use the same table 'customers' the difference is 1 boolean field 'prospect' true is customer and false are prospect, in each model have an global scope to return respective registers using boolean 'prospect' field and the relation holder of model Wallet when is prospect not found it,
How do to add a 'withoutGlobalScopes' into holder relation to model wallet??
Customer
Prospect
the morph relation use customer model but the global scope return null because that customer is prospect
git clone -b units https://github.com/bavix/laravel-wallet.git cd laravel-wallet composer install ./vendor/bin/phpunit
Yeap!
The solution are make model and config into config/wallet.php
@fatnaydev You correctly redefined the model. Thanks for information. I will know for the future.
Hi.
In the last week when try register depositFloat has next error:
I send an Wallet model
I debug directly but "($this instanceof WalletModel ? $this->holder : $this)" return null, when make inverse "($this instanceof WalletModel ? $this : $this->holder)" works fine and register deposit, how do to work fine??
This is my code: Verify hasWallet and it's correct, then save $wallet and try to make depositFloat
Model Customer has Wallet and HasWallets to have multiple wallets and user WalletFloat