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