Support the ongoing development of Laravel.io →
posted 10 years ago
Eloquent
Last updated 1 year ago.
0

This post post might give you an idea.

Last updated 1 year ago.
0
  1. First collect needed constraints from Input, then apply where() in a loop for whereHas()
  2. For this use whereHas(), like in linked post, using data from 1
  3. Your current setup will do the job: with('profile.yearGroup'), but this will load all the related models, not filtered. So should you need only filtered, use the constraints on this too.
Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

haampie haampie Joined 5 Feb 2014

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.