I am trying to write update function in laravel, and I am trying to get the old value in edit form, the text fields are easy to retrive back in the form, and also date fields is also working, but for the timestamp field, I coudn't able to get the old value.Please help me out.This simple date field is working.
<input type="date" value="{{Carbon\Carbon::parse($package->start_date)->format('Y-m-d')}}" name="start_date">
But for the timestamp field, I tried many format, for example like
<input type="datetime-local" value="{{Carbon\Carbon::parse($package->start_date)->format('Y-m-d H:i:s')}}" name="start_date">
For date input type use toDateString() method, for datetime-local input type use toDateTimeLocalString() or format('Y-m-d\TH:i:s')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With