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