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->title(trans('$faq::$faq.names')) ->view('$faq::public.faq.index') ->data(compact('$faqs')) ->output(); } /** * Show faq's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $faqs = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$faq::$faq.names')) ->view('$faq::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->title($$faq->name . trans('$faq::$faq.name')) ->view('$faq::public.faq.show') ->data(compact('$faq')) ->output(); } }