drewjbartlett / wordpress-eloquent

A library that converts converts wordpress tables into Laravel Eloquent Models.
MIT License
148 stars 45 forks source link

Allow multiple connections to be defined #8

Closed blaisedufrain closed 6 years ago

drewjbartlett commented 6 years ago

@blaisedufrain thanks a ton for doing this! Could you provide me with a better description of what it is you're changing and adding?

blaisedufrain commented 6 years ago

I added some to the read me. I am adding the ability to boot eloquent for multiple named connections. For example if you need to connect to a second mysql instance in the same request depending on the eloquent model. See https://laravel.com/docs/5.4/database#using-multiple-database-connections.

In my case I want to pull a record from one mysql instance, transform it, and save it as a new record in a different mysql instance.

I added a new function to allow a user to create multiple connections by passing an array of connection configurations. This is a non breaking change, as a configuration using your original structure will continue to produce a single connection, but if you set a new config option multiple_connections to true, then it will run the new process.

Let me know if you need more.

blaisedufrain commented 6 years ago

Is there anything else you needed for this? Everything look ok?

drewjbartlett commented 6 years ago

@blaisedufrain apologies. I will have one last look tonight and merge :)

blaisedufrain commented 6 years ago

I'm actually going to close this PR and open an identical one coming from a non master branch from my repo. That way I can use my master branch on the forked repo while waiting on this to merge. Sorry for confusion.

https://github.com/drewjbartlett/wordpress-eloquent/pull/9