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