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