->modifyQueryUsing with relations
Hello, I need to use a 'details' relation to query the state, how can I do this?
Tried to add ->with('details') or -details(), please help.
$query->with('details')->where('state', 1))
$query->details()->where('state', 1))
Thanks
Solution:Jump to solution
You are probably looking for
->whereHas('details', fn ($query) => ...)
or a simple join2 Replies
Solution
You are probably looking for
->whereHas('details', fn ($query) => ...)
or a simple joinThank you, it's working!