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