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