jcmargentina
1 year ago

Where Clause in Inner Relationship

Posted 1 year ago by jcmargentina

Hi, I am wondering what is the Eloquent way to retrieve a set of models records depending on an inner relationship query.

Example:

Model A = City Model B = State -> has an active field Model C = Country

All models have an "id" field

City belongs to State State belongs to Country

How to retrieve cities that belongs to certain State with "active" field set to 1 OR cities contained in certain specific country???

I cannot find the Eloquent Way to do this

Please sign in or create an account to participate in this conversation.