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