public function getBatchDetailsById() { $inputs = Input::all(); $batch_data = Batches::getBatchDetailsById($inputs['batch_id']); $instructor_data = User::getTeachersByFranchiseeId($batch_data['franchisee_id']); $location_data = Location::getLocationBySeasonId($batch_data['season_id']); $startDate = new DateTime($batch_data['preferred_time']); $endDate = new DateTime($batch_data['preferred_end_time']); $batch_data['preferred_time'] = $startDate->format('G:i A'); $batch_data['preferred_end_time'] = $endDate->format('G:i A'); //$batch_data['end_time']=date_format( $batch_data['end_time'], 'G:ia'); if ($batch_data) { return Response::json(array('status' => 'success', 'batchData' => $batch_data, 'instructorData' => $instructor_data, 'locationData' => $location_data)); } else { return Response::json(array('status' => 'failure')); } }