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