Tucker-Eric / EloquentFilter

An Eloquent Way To Filter Laravel Models And Their Relationships
http://tucker-eric.github.io/EloquentFilter
MIT License
1.72k stars 120 forks source link

How to filter hasManyTrough relation #92

Closed emanuellimabr closed 5 years ago

emanuellimabr commented 5 years ago

Is that possible to filter hasManyTrough relation? Every time I try I get the error "Column not found: 1054 Unknown column".

return $this->whereHas('informacoes', function($query) use ($sexo) { return $query->whereNomeAndValor('sexo', $sexo)->first(); });

emanuellimabr commented 5 years ago

My mistake! ->first() should not be there.