I am trying to validate an from with this code:
$this->validate($request, [
'address' => 'required',
'quantity' => 'required',
],
[
'address.required' => 'Endereço Invalido',
'quantity.required' => 'Quatidade Invalida'
]);
return back()->withErrors("test123");
When I dont fill the form fields it returns to the form page with no errors, but when I filled it it return with the test123 error, what am I doing wrong on the validate here ? :\
Note: as people are responding me with soluctions to return back()->withErrors("test123"); my problem is not with the return, that is just a test that I use to know if the $errors array was beeing filled correctly to the blade template, my problem is with $this->validate() that is not passing the $error array to the blade template