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