DEV Community

Sujan Khadka
Sujan Khadka

Posted on

Why input data not remaining after refresh using old() in laravel??

Top comments (1)

Collapse
 
mohitmehta1996 profile image
mohitmehta1996

See when you submit the form, all fields can be found in Request object of controller. From here if you redirect back using "withInputs" then Laravel automatically passes all form fields (from Request object) to blade, which can be accessed using old().
So when you refresh the page, controller is not even called, that's why old() is not working here.