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