DEV Community

Sujan Khadka
Sujan Khadka

Posted on

2

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.

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay