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