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