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