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