That doesn't allow for simultaneous use of both repositories, does it?
Still interested if anyone has any thoughts about this.
So, if I'm understanding the problem correctly, you have a single entity that is pulling data from multiple places, not just tables but different DBs. In my opinion, you need two things:
The downside is that you won't be able to use Eloquent for this, or at least if you tried it would be very hacky and brittle. And your repository logic is going to be somewhat complex since you're building the entity from multiple data sources. But, at the end of the day isolating that complexity in your repository implementation is the most robust and maintainable way to do it.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community