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