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