repository = $celebs; parent::__construct(); } /** * Show celebs's list. * * @param string $slug * * @return response */ protected function index() { $celebs = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('celeb::public.celebs.index', compact('celebs'))->render(); } /** * Show celebs. * * @param string $slug * * @return response */ protected function show($slug) { $celebs = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->theme->of('celeb::public.celebs.show', compact('celebs'))->render(); } }