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