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