something like this might work,
Model::where('sondage_home',1)->->orderBy(DB::raw('RAND()'))
->get()->filter(function($item){
return (($item->sondage_v1 + $item->sondage_v2) >= 40);
});
you can also use whereRaw('sql statement').
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community