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