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.

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay