Hello, I'm having problems with my laravel search function
class PesquisaController extends Controller
{
public function pesquisaMonitoramento(Request $request, Monitoramento $mot)
{
$mot = $mot->newQuery();
if($request->has('id_mot')){
$mot->where('ID_CD_INTERNACAO',$request->get('id_mot'));
}
if($request->has('ds_paciente')){
$mot->where('ID_CD_PACIENTE',$request->get('ds_paciente'));
}
if($request->has('ds_convenio')){
$mot->where('ID_CD_CONVENIO',$request->get('ds_convenio'));
}
return $mot->get();
}
}
It is a very simple test function, but it does not return anything, returns an empty json, does anyone have any idea of the reason?