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