diff --git a/app/Http/Livewire/CartProduct.php b/app/Http/Livewire/CartProduct.php index 8119709b..6b6b57ab 100644 --- a/app/Http/Livewire/CartProduct.php +++ b/app/Http/Livewire/CartProduct.php @@ -22,9 +22,8 @@ public function add() public function remove() { - // Cart::first()->cartpros()->detach($this->id); - // CartPro::destroy(['cart_id' => Cart::first(), 'product_id' => $this->id]); - CartProduct::where('product_id', $this->id)->delete(); + // CartProduct::where('product_id', $this->id)->delete(); + Cart::first()->products()->detach($this->id); } public function mount($product)