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