it throws me to error page.
With what error?
I have been browsing and I found out that I could filter vlues beeing present in array x.
I'm using the Rule::into implode the array as the documentation suggests. I'm trying to use it to filter a pagination (I don't know if this is the correct method of doing it).
Search controller
$validator = Validator::make($request->all(), [
'profissao' => 'required|present|max:50|string|Alpha',
'distrito' => 'required|max:50|string|Alpha',
'orderBy' => [
'present', // It may not be present since the user may not filter any value
'nullable', // If the value is not present then it's going to be null
Rule::in(['preco_hora', 'stars', 'fora_regiao']),
]
]);
if($validator->fails()){
return redirect('error')->withInput();
}
But if I try to simplely ask for the results without passing orderBy it throws me to error page. I have made dd($request->oderBy) and it return null as expected. I have tried adding Rule::in(['preco_hora', 'stars', 'fora_regiao', 'null']) but without any lucky.
Any thoughts?
Please or to participate in this conversation.