Support the ongoing development of Laravel.io →
Database Eloquent IOC
Last updated 1 year ago.
0

Ok guys, i just found out what was missing, a subquery in the county whereHas, pretty noobie error that i found in the queryLog. This may serve for someone in the future.

Paginator::setPageName('page_pools'); $pools = Team::where('team_type','=','pool') ->whereHas('users',function ($q) { $q->whereHas('roles', function ($q){ $q->where('name','NOT LIKE', '%Admin%'); }); }) ->whereHas('county', function($q) use ($filter){ ( $q->where(function($q2) use ($filter) { $q2->where('name','LIKE','%'.$filter.'%')->where('abrev','LIKE','%'.$filter.'%','OR'); }));}) ->paginate(9);

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

thiduzz thiduzz Joined 23 Sep 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.