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