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