Skip to content
Advertisement

Convert Query to Eloquent

How to make that query with eloquent

My relationships

I fetching the name with a given ID, but how can I find it for all. Or maybe I am thinking wrong

Advertisement

Answer

I assumed your employees Model name as Employee and companies Model name as Company

If you want to search per id then you may do as below.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement