Laravel

Laravel: Usage of old() in form when editing

Best practice to show old value when editing a form in Laravel?
Laravel function old have default parameter if no old data found in session default value will be displayed.

function old($key = null, $default = null)

Replace expression in template with the default object data.

<input name="title" value="{{old('title', $post->title)}}" />



Further Resources:
How to Hire a Great Laravel Developer

Author: Danyal
I'm a skilled programmer specializing in Vue.js/Nuxt.js for front-end development and PHP Laravel for back-end solutions. I have a strong focus on API design and development, complemented by experience in web server setup and maintenance. My versatile expertise ensures seamless creation and maintenance of web applications, covering everything from intuitive user interfaces to robust server-side functionality. Passionate about coding and driven by a lifelong learning mindset, I invite you to explore more at danyal.dk.