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