I want to display the old data in blade after redirect. So if the old data is empty or doesn't exists it should display my passed task data multidimensional array.
Laravel:
redirect()->withInput();
Blade:
name ="task[{{$dayKey}}][]"
value="{{old('task.'.$dayKey.'.'.$key) or $task}}"
Separately {{old('task.'.$dayKey.'.'.$key) and $task works fine but
if i used or the output is every time 1.
You can set default value with comma separated second argument.
value="{{old('task.'.$dayKey.'.'.$key, $task)}}"
This will check for old input value, if there is no old input value then will set the default one.
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