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('education::deal.names')) ->view('education::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('education::deal.name')) ->view('education::public.deal.show') ->data(compact('deal')) ->output(); } }