mardi 7 janvier 2020

Laravel empty the request without redirect

In Laravel 5.8, I have a form with multiple search parameters. If a user clicks reset I want to reset all request values. In my Controller index():

if ($request->input('reset')) {
    $request->flush();
}

However when I check $request after flush the values are still present. So if I return the view() the request is still present. However if I redirect the user back to the index the request has cleared successfully. Is there a way to empty the request without calling a redirect?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2FqCXcG
via IFTTT

Aucun commentaire:

Enregistrer un commentaire