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