if($state) {
if(count($get('working_hours')) === 0) {
foreach (DayOfWeek::cases() as $index => $dayOfWeek) {
$set("working_hours.$index.day", CompanyHelper::company()->working_hours[$index]['day'] ?? null);
$set("working_hours.$index.start", CompanyHelper::company()->working_hours[$index]['start'] ?? null);
$set("working_hours.$index.end", CompanyHelper::company()->working_hours[$index]['end'] ?? null);
}
}
return;
}
if($state) {
if(count($get('working_hours')) === 0) {
foreach (DayOfWeek::cases() as $index => $dayOfWeek) {
$set("working_hours.$index.day", CompanyHelper::company()->working_hours[$index]['day'] ?? null);
$set("working_hours.$index.start", CompanyHelper::company()->working_hours[$index]['start'] ?? null);
$set("working_hours.$index.end", CompanyHelper::company()->working_hours[$index]['end'] ?? null);
}
}
return;
}