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