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->title(trans('$plan::$plan.names')) ->view('$plan::public.plan.index') ->data(compact('$plans')) ->output(); } /** * Show plan's list based on a type. * * @param string $slug * * @return response */ protected function list($type = null) { $plans = $this->repository ->pushCriteria(app('Litepie\Repository\Criteria\RequestCriteria')) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->response->title(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->title($$plan->name . trans('$plan::$plan.name')) ->view('$plan::public.plan.show') ->data(compact('$plan')) ->output(); } }