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