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