cartCount = ClassesCart::items()->count(); if ($this->cartCount === 0) { $this->skipRender(); } } #[On('cartUpdated')] public function onCartUpdated() { $this->cartCount = ClassesCart::items()->count(); } public function render() { return view('components.cart'); } }