mardi 23 février 2016

laravel eloquent peform wherehas

I'm trying to build a filtersystem on my company's page. I have a page that loads the company's, but now the query excutes on page load and loads the values to search for or sort by. Now is my question how do I execute the wherehas on form submit on the same page? This is what I have for now.

$companys = Company::wherehas('reviews', function($query) use($Rstars){
            $query->where('stars', '=', $Rstars);
        })->orderBy('created_at', $request->cdate)->paginate(15);



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire