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

how insert data bank_method transactions table ? #105

Closed
khanhnam99 opened this issue Sep 18, 2019 · 5 comments
Closed

how insert data bank_method transactions table ? #105

khanhnam99 opened this issue Sep 18, 2019 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@khanhnam99
Copy link

khanhnam99 commented Sep 18, 2019

In transactions(
payable_type,
payable_id,
wallet_id,
type,
amount,
confirmed,
meta,
uuid,
created_at,
updated_at
) table

Then i added a column name bank_method

$user = User::first();
$user->balance; // int(0)
$user->deposit(10);

$bank_method ='VietComBank';

Now , i want insert bank_method into $user->deposit(10,$bank_method);

how i can do that ?

Capture

@rez1dent3
Copy link
Member

@khanhnam99
Out of the box - no way. You need to inherit from the wallet model and add your parameters.
If you do not know how to do this, I can make an example tomorrow.

I would not advise you to add your fields and overload models. In the future, you will not be able to easily update the library.

I recommend working with a json meta type field.

$user->deposit(100, ['bank_method' => 'VietComBank']);

By json field you can filter and work with it.
https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html

@rez1dent3 rez1dent3 self-assigned this Sep 18, 2019
@khanhnam99
Copy link
Author

thanks

@rez1dent3 rez1dent3 added the question Further information is requested label Sep 19, 2019
@rez1dent3
Copy link
Member

@khanhnam99 Still have more questions?

@rez1dent3
Copy link
Member

So there are no questions. I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants