repository = $cliente; parent::__construct(); } /** * Show cliente's list. * * @param string $slug * * @return response */ protected function index() { $clientes = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$cliente::$cliente.names')) ->view('$cliente::public.cliente.index') ->data(compact('$clientes')) ->output(); } /** * Show cliente's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $clientes = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$cliente::$cliente.names')) ->view('$cliente::public.cliente.index') ->data(compact('$clientes')) ->output(); } /** * 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->response->title($$cliente->name . trans('$cliente::$cliente.name')) ->view('$cliente::public.cliente.show') ->data(compact('$cliente')) ->output(); } }