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