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