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