我是Laravl的新手,我尝试用一列搜索,这是我的代码,但是现在我想用多列搜索,我怎么做?
我的控制器:
public function search_pers(Request $request)
{
$mle = $request->input('mle');
$listpers = Personne::where('mle', 'LIKE', '%'.$mle.'%')->get();
return view('frontend.etat_civil', ['personnes' => $listpers]);
}
您可以使用数组
Personne::where([
['col1', '=', 'value1'],
['col2', '<>', 'value2'],
[Your_col, OPERATOR, value],
...
])