repository = $institute_course; parent::__construct(); } /** * Show institute_course's list. * * @param string $slug * * @return response */ protected function index() { $institute_courses = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$institute::$institute_course.names')) ->view('$institute::public.institute_course.index') ->data(compact('$institute_courses')) ->output(); } /** * Show institute_course's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $institute_courses = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$institute::$institute_course.names')) ->view('$institute::public.institute_course.index') ->data(compact('$institute_courses')) ->output(); } /** * Show institute_course. * * @param string $slug * * @return response */ protected function show($slug) { $institute_course = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$institute_course->name . trans('$institute::$institute_course.name')) ->view('$institute::public.institute_course.show') ->data(compact('$institute_course')) ->output(); } }