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