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