title: livewire wire:click function doesnt put a product in the cart that i want
body: <p>hey guys i got a problem with my button, it doesnt do the function that i want nor give me any error so i dont know what happen
  here are some of my cart controller code</p>
  <pre><code>$products = Product::orderBy('created_at', 'DESC')-&gt;get();
  
          $condition = new \Darryldecode\Cart\CartCondition([
              'name' =&gt; 'pajak',
              'type' =&gt; 'tax',
              'target' =&gt; 'total',
              'value' =&gt; $this-&gt;tax,
              'order' =&gt; 1
          ]);
  
          \Cart::session(Auth()-&gt;id())-&gt;condition($condition);
          $items = \Cart::session(Auth()-&gt;id())-&gt;getContent()-&gt;sortBy(function ($cart){
              return $cart-&gt;attributes-&gt;get('added_at');
          });
  
          if(\Cart::isEmpty()){
              $cartData = [];
          }else{
              foreach($items as $item){
                  $cart[] = [
                      'rowId' =&gt; $row-&gt;id,
                      'name' =&gt; $item-&gt;name,
                      'pricesingle' =&gt; $item-&gt;harga,
                      'price' =&gt; $item-&gt;getPriceSum(),
                  ];
              }
              
              $cartData = collect($cart);
          }
  
          $sub_total = \Cart::session(Auth()-&gt;id())-&gt;getSubTotal();
          $total = \Cart::session(Auth()-&gt;id())-&gt;getTotal();
  
          $newCondition = \Cart::session(Auth()-&gt;id())-&gt;getCondition('pajak');
          $pajak = $newCondition-&gt;getCalculatedValue($sub_total);
  
          $summary = [
              'sub_total' =&gt; $sub_total,
              'pajak' =&gt; $pajak,
              'total' =&gt; $total
          ];
  
          return view('livewire.cart-component', [
              'products' =&gt; $products,
              'carts' =&gt; $cartData,
              'summary' =&gt; $summary
          ]);
      }
  
      public function addItem($id){
          $rowId = &quot;Cart&quot;.$id;
          $cart = \Cart::session(Auth()-&gt;id())-&gt;getContent();
          $cekItemId = $cart-&gt;whereIn('id', $rowId);
  
          if($cekItemId-&gt;IsNotEmpty()){
              \Cart::session(Auth()-&gt;id())-&gt;update($rowId, [
                  'quantity' =&gt;[
                      'relative' =&gt; true,
                      'value' =&gt; 1
                  ]
              ]);
          }else{
              $product = Product::findOrFail($id);
              \Cart::session(Auth()-&gt;id())-&gt;add([
                  'id' =&gt; &quot;Cart&quot;.$product-&gt;id,
                  'name' =&gt; $product-&gt;name,
                  'price' =&gt; $product-&gt;harga,
                  'quantity' =&gt; 1,
                  'attributes' =&gt;[
                      'added_at' =&gt; Carbon::now() 
                  ],
              ]);
          }
  </code></pre>
  <p>and here are the product blade code</p>
  <pre><code>    &lt;div class=&quot;container project-items mt-4 mb-5&quot;&gt;
          &lt;div class=&quot;row justify-content-center&quot;&gt;
              @foreach ($products as $product)
                  &lt;div class=&quot;col-lg-6 col-md-7 mb-4&quot;&gt;
                      &lt;div class=&quot;card&quot;&gt;
                          &lt;img class=&quot;card-img-top&quot; src=&quot;{{ asset('produkListJasa') }}/{{$product-&gt;image}}&quot; alt=&quot;{{$product-&gt;name}}&quot;&gt;
                          &lt;div class=&quot;card-body&quot;&gt;
                              &lt;p class=&quot;text-center font-weight-bold card-text&quot;&gt;{{$product-&gt;name}}&lt;/p&gt;
                              &lt;div class=&quot;text-center font-weight-bold wrap-price&quot;&gt;&lt;span class=&quot;product-price&quot;&gt;Rp. {{$product-&gt;harga}}&lt;/span&gt;&lt;/div&gt;
                              &lt;!-- Buttonnya percobaan doang  --&gt;
                              &lt;button wire:click=&quot;addItem({{$product-&gt;id}})&quot; class=&quot;btn btn-primary btn-sm btn-block&quot;&gt;Add To Cart&lt;/button&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              @endforeach
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  <p>and here are my cart blade code so that when product button clicked, the product and price goes in to this cart blade</p>
  <pre><code>&lt;div class=&quot;container&quot;&gt;
      &lt;div class=&quot;row&quot;&gt;
          &lt;div class=&quot;card&quot;&gt;
              &lt;div class=&quot;card-body&quot;&gt;
                  &lt;h2 class=&quot;font-weight-bold text-center&quot;&gt;Cart&lt;/h2&gt;
                  &lt;table class=&quot;table table-sm table-bordered table-striped table-hovered&quot;&gt;
                      &lt;thread&gt;
                          &lt;tr&gt;
                              &lt;th&gt;No&lt;/th&gt;
                              &lt;th&gt;Name&lt;/th&gt;
                              &lt;th&gt;Price&lt;/th&gt;
                          &lt;/tr&gt;
                      &lt;/thread&gt;
                  &lt;/table&gt;
                  &lt;tbody&gt;
                      @forelse($carts as $index=&gt;$cart)
                          &lt;tr&gt;
                              &lt;td&gt;{{$index + 1}}&lt;/td&gt;
                              &lt;td&gt;{{$cart['name']}}&lt;/td&gt;
                              &lt;td&gt;{{$cart['harga']}}&lt;/td&gt;
                          &lt;/tr&gt;
                      @empty
                          &lt;td colspan=&quot;3&quot;&gt;&lt;h6 class=&quot;text-center font-weight-bold&quot;&gt;Empty Cart&lt;/h6&gt;&lt;/td&gt;
                          &lt;div class=&quot;image d-flex mt-5 justify-content-center&quot;&gt;
                              &lt;img src=&quot;foto/cart_empty.png&quot; alt=&quot;cart visual&quot; width=&quot;1200&quot; height=&quot;800&quot;&gt;
                          &lt;/div&gt;
                      @endforelse
                  &lt;/tbody&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>i dont know if its from the livewire or laravel or anything, im still learning about this and just following some tutorial video
  i hope anyone can help me
  thank you</p>