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