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