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