The issue seems to be with how the opening and closing times are being displayed in the show view. Currently, the code is trying to access $company->opening_time and $company->closing_time, but these properties do not exist in the $company object. Instead, the opening and closing times are stored as arrays in the opening_times and closing_times properties.
To fix this, you need to loop through the opening_times and closing_times arrays and display the corresponding values for each day. Here's an updated version of the show view code:
@foreach(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] as $day)
<input type="checkbox" name="days[]" value="{{ $day }}" {{ in_array($day, json_decode($company->days)) ? 'checked' : '' }}> {{ $day }}
<!-- Display opening and closing times for each day -->
Opening Time: <input type="time" name="opening_times[]" value="{{ $company->opening_times[$loop->index] ?? '' }}">
Closing Time: <input type="time" name="closing_times[]" value="{{ $company->closing_times[$loop->index] ?? '' }}">
<br>
@endforeach
This code uses the $loop->index variable to access the corresponding index in the opening_times and closing_times arrays. It also uses the null coalescing operator (??) to handle cases where the array index might not exist.
Make sure to update your code accordingly and test it to see if the opening and closing times are now displayed correctly.