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