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