Skip to content

Commit

Permalink
render alreadyAdded query update
Browse files Browse the repository at this point in the history
  • Loading branch information
golam-sorwar committed Aug 17, 2019
1 parent 7a45491 commit 4111f5d
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 @@ -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(),
]
);
}
Expand Down

0 comments on commit 4111f5d

Please sign in to comment.