middleware('web'); $this->setupTheme(config('theme.themes.public.theme'), config('theme.themes.public.layout')); $this->repository = $tender; parent::__construct(); } /** * Show tender's list. * * @param string $slug * * @return response */ protected function index() { $tenders = $this->repository ->pushCriteria(new \Litecms\Tender\Repositories\Criteria\TenderPublicCriteria()) ->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('tender::public.tender.index', compact('tenders'))->render(); } /** * 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->theme->of('tender::public.tender.show', compact('tender'))->render(); } }