middleware('web'); $this->setupTheme(config('theme.themes.public.theme'), config('theme.themes.public.layout')); $this->repository = $card; parent::__construct(); } /** * Show card's list. * * @param string $slug * * @return response */ protected function index() { $cards = $this->repository ->pushCriteria(new \Beau\Card\Repositories\Criteria\CardPublicCriteria()) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('card::public.card.index', compact('cards'))->render(); } /** * 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->theme->of('card::public.card.show', compact('card'))->render(); } }