I try to get the result of search queries with a where
clause in the query using TNTSearch, but it doesn't work. The query didn't get the where
clause.
Controller
<?php
public function getLigues(Request $request)
{
if ($request->has('recherche')) {
$ligues = Structure::search($request->recherche)->where('type_structure_id', '2')->get();
} else {
$ligues = Structure::where('type_structure_id', 2)->paginate(1);
}
return view('structure/ligues', compact('ligues'));
}
Does anyone have any ideas on how to get the filter query?