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