bavix / laravel-wallet

It's easy to work with a virtual wallet
https://bavix.github.io/laravel-wallet/
MIT License
1.14k stars 230 forks source link

how insert slug, name in table wallets #63

Closed khanhnam99 closed 5 years ago

khanhnam99 commented 5 years ago

ex: slug have a name 'coin' , or 'bit'

how insert slug, name in table wallets $user = User::first();

rez1dent3 commented 5 years ago

@khanhnam99 https://bavix.github.io/laravel-wallet/#/new-wallet?id=create-a-wallet

khanhnam99 commented 5 years ago

in my controller

$user = User::first(); $wallet = $user->createWallet([ 'name' => 'New Wallet', 'slug' => 'my-wallet', ]); $wallet->deposit(100);

    exit;

Capture

khanhnam99 commented 5 years ago

$user = User::first(); $wallet = $user->createWallet([ 'name' => 'New Wallet', 'slug' => 'my-wallet', 'holder_type' => 'App\Models\User\User', ]); $wallet->deposit(100);

    exit;

Capture

rez1dent3 commented 5 years ago

Can not reproduce. I'll try tomorrow.

the code is fine, this problem should not be https://github.com/bavix/laravel-wallet/blob/master/src/Models/Wallet.php#L34

rez1dent3 commented 5 years ago

@khanhnam99 I can not reproduce. I need your code: models, controller, etc. https://github.com/bavix/laravel-wallet/blob/master/tests/MultiWalletTest.php#L303

khanhnam99 commented 5 years ago

thanks

rez1dent3 commented 5 years ago

51

rez1dent3 commented 5 years ago

@khanhnam99 I studied the code carefully and kind of found a possible problem. I fixed it in version 3.1 and wrote unit tests. Release 3.1 will be released within an hour.

rez1dent3 commented 5 years ago

@khanhnam99 Version 3.1 has been released. Please check this error.

Kuraj11101 commented 4 years ago

How do I assign a new empty wallet to every newly registered users and manually allow deposit from a credit and sending to another user manually?