Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

It's not technically possible, as a join statement will be executed as a SQL query on a single database.

0

Any solution to this problem? create microservico rest? to be consumed in the application. What would you tell me?

0

Make two separate queries would be the most obvious path.

0

you have an example? I am beginner and to a little lost.

0

Assuming you have the foreign key defined in contacts, you'll have something like :

SELECT * FROM contacts

Then retrieve the client_id's as an array :

SELECT * FROM clients WHERE id IN (1,2,3,4,...)
0

Sign in to participate in this thread!

Eventy

Your banner here too?

eduavila eduavila Joined 7 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.