I have a Laravel application that shows lists of cars make, model, year, trim.
When page loads list of make is displayed, user then clicks specific make and all model are displayed, etc.
These are my tables (already created relationships):
make
- id
model
- id
- id_make
year
- id
- id_model
trim
- id
- id_year
When showing list of make, how can i query only make with at least one model with at least one year with at least one trim?