Reputation: 324
Want to show previous data on the edit Page.
I'm trying this
<input type="time" name="opening_hour" value="{{ old('opening_hour', $restaurants->opening_hour) }}" class="form-control">
in Database, the opening_hour field is time type. value is 10:00:00
but when I try to show in time type input field it getting an error array_key_exists(): The first argument should be either a string or an integer
What should I do in laravel blade?
Upvotes: 0
Views: 463
Reputation: 324
found my solutions. it will be date('H:i', strtotime($restaurants->opening_hour))
inside value.
Upvotes: 0