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