title: Wrong array detail in laravel
body: <p>I want get my product conditions as array in order to add them in cart, this is <code>dd</code> of my product when I try to add it in my cart:</p>
  
  <pre><code>array:6 [▼
    "id" =&gt; 4
    "name" =&gt; "product four"
    "price" =&gt; null
    "quantity" =&gt; "1"
    "attributes" =&gt; array:1 [▼
      "attr" =&gt; array:2 [▼
        "name" =&gt; "weight"
        "value" =&gt; "45"
      ]
    ]
    "conditions" =&gt; array:2 [▼
      0 =&gt; CartCondition {#685 ▼ // need to add this
        -args: array:4 [▼
          "name" =&gt; "Black"
          "value" =&gt; "10000"
          "type" =&gt; "additional"
          "target" =&gt; "item"
        ]
        -parsedRawValue: null
      }
      1 =&gt; CartCondition {#692 ▼ // need to add this
        -args: array:4 [▼
          "name" =&gt; "12 inch"
          "value" =&gt; "25000"
          "type" =&gt; "additional"
          "target" =&gt; "item"
        ]
        -parsedRawValue: null
      }
    ]
  ]
  </code></pre>
  
  <blockquote>
    <p>As you see unlike my <code>attributes</code> my <code>conditions</code> not show just as
    array but get values in <code>-args:</code> and <code>-parsedRawValue: null</code></p>
  </blockquote>
  
  <p>When I try to add product in cart I get this error:</p>
  
  <pre><code>Darryldecode \ Cart \ Exceptions \ InvalidItemException
  validation.required
  </code></pre>
  
  <p><a href="https://ibb.co/mZy3RS" rel="nofollow noreferrer">Error</a></p>
  
  <p>This is my function (how I get my <code>conditions</code> and where i use them:</p>
  
  <pre><code>public function addingItem(Request $request, $id)
  {
        //finding product
        $product = Product::findOrFail($id);
        //get product weight
        $weight = $product-&gt;weight;
        //list of discounts
        $discounts = Discount::all();
        //get current time
        $mytime = Carbon::now();
  
        // get product weight in cart as attribute
        $weightArray = [
          'attr' =&gt; [
                'name' =&gt; 'weight',
                'value' =&gt; $weight,
          ]
        ];
  
  
        $customAttributes = [];  // my conditions comes from here
        if(!empty($request-&gt;attr)){
            foreach($request-&gt;attr as $sub) {
            // find the suboption
                $sub = Suboption::find($sub);
                if (!empty($sub-&gt;id)) {
                    $itemCondition1 = new \Darryldecode\Cart\CartCondition(array(
                        'name' =&gt; $sub-&gt;title,
                        'value' =&gt; $sub-&gt;price,
                        'type' =&gt; 'additional',
                        'target' =&gt; 'item',
                    ));
  
                    array_push($customAttributes, $itemCondition1);
                }
            }
        }
  
        //adding product, options and conditions to cart
        Cart::add(array(
          'id' =&gt; $product-&gt;id,
          'name' =&gt; $product-&gt;title,
          'price' =&gt; $request-&gt;input('harga'),
          'quantity' =&gt; $request-&gt;input('quantity'),
          'attributes' =&gt; $weightArray,
          'conditions' =&gt; $customAttributes,  // added here
        ));
        Session::flash('success', 'This product added to your cart successfully.');
        return redirect()-&gt;back();
  }
  </code></pre>
  
  <p>any idea why i get this error and how to fix it?</p>