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