-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use both MySQL Models and MongoDB models #6
Comments
Did you register an alias, or only the serviceProvider? |
Hi, I only put in the service provider as per the docs. The alias for Eloquent is still: 'Eloquent' => 'Illuminate\Database\Eloquent\Model', Thanks |
Do you get this error?
I will check how I can solve this problem. |
The ConnectionResolver was indeed overwritten by the Mongo model. Update your version and it should work :) |
Awesome! I can confirm that the above fix sorted the issue. Many thanks :) |
I have set mysql as my defaut db and set mongodb as a second. When I print DB::connection('mongodb'), it was still pull my mysql db name. Could u help me with this issue please? |
…bute Merged from halaei:fix-test-asser-object-not-has-attribute
…tests (mongodb#6) * PHPORM-45 Add Query\Builder::toMql() to simplify comprehensive query tests * Move Query/Builder unit tests to a dedicated test class
…s-attribute Merged from halaei:fix-test-asser-object-not-has-attribute
Our application uses both MySQL and MongoDB connections, but I'm afraid I can't get both working together.
I have tried various things such as tweaking namespaces etc. If I remove the 'Jenssegers\Mongodb\MongodbServiceProvider' from providers the MySQL eloquent models work as expected.
Is there any way to get them working side by side? My guess is the ConnectionResolver has been changed and its breaking MySQL models.
Im quite new to Laravel so not 100% if the above this the problem.
The text was updated successfully, but these errors were encountered: