I was using validator inside controller and it can sent messages through session.
return redirect()->back()
->withErrors($validator)
->with([
'editModal' => 'editModal',
'msg' => $msg
]);
Then, I tried using FormRequest in Laravel. This FormRequest works, but I want to send some data with session if validation is failed. But I can not find the good way, I just can send it using
$validator->errors()->add
Is there a way to send a message through session like with() in controller?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire