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