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