Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade from 6.x.x to last verision #531

Closed
abdosaeedelhassan opened this issue Jul 26, 2022 · 4 comments
Closed

upgrade from 6.x.x to last verision #531

abdosaeedelhassan opened this issue Jul 26, 2022 · 4 comments
Assignees
Labels
duplicate This issue or pull request already exists question Further information is requested upgrade

Comments

@abdosaeedelhassan
Copy link

Hi, i did all migration step but i received next error

[2022-07-26 20:08:50] local.ERROR: Bavix\Wallet\Services\CastService::getWallet(): Argument #1 ($object) must be of type Bavix\Wallet\Interfaces\Wallet, null given, called in /home/abdelrahman/Code/tyqn/vendor/bavix/laravel-wallet/src/Commands/TransferFixCommand.php on line 37 {"exception":"[object] (TypeError(code: 0): Bavix\Wallet\Services\CastService::getWallet(): Argument #1 ($object) must be of type Bavix\Wallet\Interfaces\Wallet, null given, called in /home/abdelrahman/Code/tyqn/vendor/bavix/laravel-wallet/src/Commands/TransferFixCommand.php on line 37 at /home/abdelrahman/Code/tyqn/vendor/bavix/laravel-wallet/src/Services/CastService.php:28)
[stacktrace]
#0 /home/abdelrahman/Code/tyqn/vendor/bavix/laravel-wallet/src/Commands/TransferFixCommand.php(37): Bavix\Wallet\Services\CastService->getWallet()
#1 /home/abdelrahman/Code/tyqn/vendor/bavix/laravel-wallet/src/Commands/TransferFixCommand.php(25): Bavix\Wallet\Commands\TransferFixCommand->fix()
#2 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(98): Bavix\Wallet\Commands\TransferFixCommand->Bavix\Wallet\Commands\{closure}()
#3 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(53): Illuminate\Database\Eloquent\Builder->Illuminate\Database\Concerns\{closure}()
#4 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(102): Illuminate\Database\Eloquent\Builder->chunk()
#5 /home/abdelrahman/Code/tyqn/vendor/bavix/laravel-wallet/src/Commands/TransferFixCommand.php(25): Illuminate\Database\Eloquent\Builder->each()
#6 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Bavix\Wallet\Commands\TransferFixCommand->handle()
#7 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#8 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#9 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#10 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\Container\BoundMethod::call()
#11 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Console/Command.php(139): Illuminate\Container\Container->call()
#12 /home/abdelrahman/Code/tyqn/vendor/symfony/console/Command/Command.php(308): Illuminate\Console\Command->execute()
#13 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Console/Command.php(124): Symfony\Component\Console\Command\Command->run()
#14 /home/abdelrahman/Code/tyqn/vendor/symfony/console/Application.php(998): Illuminate\Console\Command->run()
#15 /home/abdelrahman/Code/tyqn/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#16 /home/abdelrahman/Code/tyqn/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#17 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\Component\Console\Application->run()
#18 /home/abdelrahman/Code/tyqn/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()
#19 /home/abdelrahman/Code/tyqn/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#20 {main}

@abdosaeedelhassan abdosaeedelhassan added the question Further information is requested label Jul 26, 2022
@rez1dent3 rez1dent3 added the duplicate This issue or pull request already exists label Jul 26, 2022
@rez1dent3
Copy link
Member

rez1dent3 commented Jul 26, 2022

Hello. duplicate #500
You need to upgrade to 6.2.4, and then upgrade further.

Don't forget the update instructions.
https://bavix.github.io/laravel-wallet/#/upgrade-guide

@abdosaeedelhassan
Copy link
Author

Thank you for your response, i upgraded the project to laravel 9 and i can't do downgrade the package to (6.2.4), i already did the migration step of uuid filed and change the config file to new one, when i tired the command (php artisan bx:transfer:fix), i received that:
`TypeError

Bavix\Wallet\Services\CastService::getWallet(): Argument #1 ($object) must be of type Bavix\Wallet\Interfaces\Wallet, null given, called in /home/abdelrahman/Code/tyqn/vendor/bavix/laravel-wallet/src/Commands/TransferFixCommand.php on line 37

at vendor/bavix/laravel-wallet/src/Services/CastService.php:28
24▕
25▕ /**
26▕ * @throws ExceptionInterface
27▕ */
➜ 28▕ public function getWallet(Wallet $object, bool $save = true): WalletModel
29▕ {
30▕ $wallet = $this->getModel($object);
31▕ if (!($wallet instanceof WalletModel)) {
32▕ $wallet = $wallet->getAttribute('wallet');

  +19 vendor frames 

20 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
`

@abdosaeedelhassan
Copy link
Author

when i comment the traits and implement the wallet like next
class User extends BaseUser // implements Wallet //, WalletFloat { use UserAttribute, UserMethod, UserRelationship, UserScope, //HasWalletFloat, // HasWallet, // HasWallets, HasApiTokens;
the problem will solved , i fresh migrate all package table (transfer,transactions,wallet), but the error that
local.ERROR: Maximum execution time of 30 seconds exceeded {"userId":1,"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Maximum execution time of 30 seconds exceeded at /home/abdelrahman/Code/tyqn/vendor/bavix/laravel-wallet/src/Internal/Service/StorageService.php:40)

is there a cache or something need to clear?

Thank you

@abdosaeedelhassan
Copy link
Author

I don't know what happen, but after more of trying the problem solved, Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists question Further information is requested upgrade
Projects
None yet
Development

No branches or pull requests

2 participants