@foreach($days as $key=>$day)
@php
$from_time='';
$to_time='';
$dayoff=0;
@endphp
@if($day->timesheet->count()>0)
@php
$from_time=isset($day->timesheet[0]->from_time) ? $day->timesheet[0]->from_time : '';
$to_time=isset($day->timesheet[0]->to_time) ? $day->timesheet[0]->to_time : '';
$dayoff=$day->timesheet[0]->active;
@endphp
@endif
@endforeach