bavix / laravel-wallet

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

I want to change the default database #248

Closed NotMings closed 3 years ago

NotMings commented 3 years ago

There are two database connections in my project. I want to connect to another database, do I support the connection attribute, and what should I do.

Use version lumen 7.2 laravel-wallet 5.3

rez1dent3 commented 3 years ago

Hey, @AdminWELT. Not at the moment, but a good idea. Perhaps I add this functionality to 6.x, but it is not accurate.

You can override 3 models and assign any connection to them.

NotMings commented 3 years ago

I tried to copy the files under model to app/models and change the config, but it didn't work. This may be the reason for lumen. I can only change the original model file in the vendor. I don't want to change the source code. Is there any other way?

odion-cloud commented 3 years ago

I tried to copy the files under model to app/models and change the config, but it didn't work. This may be the reason for lumen. I can only change the original model file in the vendor. I don't want to change the source code. Is there any other way?

learn about laravel extend model ,you don't need to copy the model create a new model and extend it with original model https://learn.userfrosting.com/recipes/extending-the-user-model

rez1dent3 commented 3 years ago

No more questions. I am closing the issue. There will be questions - reopen or create a new one.