public static function update($id, $data) { if (isset($data['eventname']) && empty($data['eventname'])) { return print json_encode(array('success' => false, 'status' => 400, 'msg' => 'Activity Name is required')); } if (isset($data['eventdescription']) && empty($data['eventdescription'])) { return print json_encode(array('success' => false, 'status' => 400, 'msg' => 'Start date is required')); } if (isset($data['eventdate']) && empty($data['eventdate'])) { return print json_encode(array('success' => false, 'status' => 400, 'msg' => 'End date is required')); } EventModel::update($id, $data); }