diff --git a/app/Http/Livewire/CartProduct.php b/app/Http/Livewire/CartProduct.php index be6690fd..8119709b 100644 --- a/app/Http/Livewire/CartProduct.php +++ b/app/Http/Livewire/CartProduct.php @@ -36,9 +36,8 @@ public function mount($product) public function render() { - return view('livewire.cart-product' - , [ - 'alreadyAdded' => AppCartProduct::where('product_id',$this->id)->exists(), + return view('livewire.cart-product', [ + 'alreadyAdded' => Cart::first()->products()->whereId($this->id)->exists(), ] ); }