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