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