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