Working version of the schedulecontroller.php using serialize. Had to
serialize the userschedule obj->to_array() and unserialize
(serialize(obj->to_array()))
Working schedule.