repository = $deposit; parent::__construct(); } /** * Show deposit's list. * * @param string $slug * * @return response */ protected function index() { $deposits = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$deposit::$deposit.names')) ->view('$deposit::public.deposit.index') ->data(compact('$deposits')) ->output(); } /** * Show deposit's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $deposits = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(trans('$deposit::$deposit.names')) ->view('$deposit::public.deposit.index') ->data(compact('$deposits')) ->output(); } /** * Show deposit. * * @param string $slug * * @return response */ protected function show($slug) { $deposit = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$deposit->name . trans('$deposit::$deposit.name')) ->view('$deposit::public.deposit.show') ->data(compact('$deposit')) ->output(); } }