Skip to content

Commit

Permalink
update remove query using detach
Browse files Browse the repository at this point in the history
  • Loading branch information
golam-sorwar committed Aug 17, 2019
1 parent 4111f5d commit 8ce9dc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/Http/Livewire/CartProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8ce9dc1

Please sign in to comment.