/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { // $this->html->course = \Pinom\Models\Courses::find($id); if (!isset($this->html->course)) { return Redirect::to('/'); } $this->html->modules = array(); $courses_sections = \Pinom\Models\CoursesSections::where('course', '=', $id)->orderBy('section', 'ASC')->get(); foreach ($courses_sections as $cs) { $this->html->modules[$cs->section] = \Pinom\Models\CoursesModules::whereIn('id', explode(',', $cs->sequence))->get(); } return view($this->html->config->theme_folder . '.course-detail')->with('html', $this->html); }