repository = $plans; parent::__construct(); } /** * Show plans'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::$plans.names')) ->view('$plan::public.plans.index') ->data(compact('$plans')) ->output(); } /** * Show plans'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::$plans.names')) ->view('$plan::public.plans.index') ->data(compact('$plans')) ->output(); } /** * Show plans. * * @param string $slug * * @return response */ protected function show($slug) { $plans = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->response->title($$plans->name . trans('$plan::$plans.name')) ->view('$plan::public.plans.show') ->data(compact('$plans')) ->output(); } }