public function get_shift_session() { $shiftSessions = ShiftSession::all(); foreach ($shiftSessions as &$shiftSession) { $shiftSession->start_time = format_time(strtotime($shiftSession->start_time)); $shiftSession->end_time = format_time(strtotime($shiftSession->end_time)); $shiftSession->active = $shiftSession->active == 1; } return response()->json($shiftSessions); }