0
I have 3 layers of entities, of which I only want the third object. but based on the information of the first 2.
For example, I have manufactures that manufactures cars and each car has a kind of wheel. I want all the wheels manufactured by a factory.
I don’t know how to do this using eloquent, The only idea I had was to make several hasMany to get this data. but I’m afraid it’s not the most efficient way because I’ll end up taking data that won’t be used.
I tried it but it didn’t work as well as I wanted.
DB::raw('select results from hectars h,consultas c,results r where h.id_fazendeiro=? and h.id=c.id_hectar and c.id = r.id_consulta',[$id]);
It is not quite what I wish. It is more to chain various objects. I have information of the father, and I want all fulhos.
– Andersoney Rodrigues