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