I am trying to use Laravel Eloquent ORM to do a simple one to one relationship on two different connections.
Let say I do :
MyModel::on('secondary_connection')->get()
That is working fine.
When I do :
MyModel::on('secondary_connection')->with('AnotherModel')->get();
I am getting an error because eloquent is doing the AnotherModel SELECT statement on the default connection (instead of "secondary_connection").
I can't find a way to work this around.
My models are well defined since I can join them in my default connection.
Thoughts ?