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