title: laravel return array to string conversion error
body: <p>I have store method in my controller and it returns this errors:</p>
  <h1>Errors</h1>
  <p>Console <code>Preview tab</code></p>
  <pre><code>exception: &quot;ErrorException&quot;
  file: &quot;C:\........\vendor\laravel\framework\src\Illuminate\Support\Str.php&quot;
  line: 419
  message: &quot;Array to string conversion&quot;
  </code></pre>
  <p>Console <code>Response tab</code></p>
  <pre><code>   {
          &quot;file&quot;: &quot;C:\\........\\app\\Http\\Controllers\\Api\\Front\\CartController.php&quot;,
          &quot;line&quot;: 380,
          &quot;function&quot;: &quot;save&quot;,
          &quot;class&quot;: &quot;Illuminate\\Database\\Eloquent\\Model&quot;,
          &quot;type&quot;: &quot;-&gt;&quot;
      },
  </code></pre>
  <h1>Code</h1>
  <pre><code>public function checkout(Request $request)
  {
      $user = auth('api')-&gt;user();
      $cartItems = CartStorage::where('user_id', $user-&gt;id)-&gt;get();
      $address = AddressUser::where('id', $request-&gt;input('address'))-&gt;first();
  
      foreach($cartItems as $item) {
          $cartData = $item-&gt;cart_data;
          // add to orders table
          try {
              $order = new Order();
              $order-&gt;ordernu = 'Si-'.mt_rand(1000000000, 9999999999);
              $order-&gt;user_id = $user-&gt;id;
              $order-&gt;order_data = $cartData;
              $order-&gt;quantity = $cartData['quantity'];
              $order-&gt;price = $request-&gt;input('totalPrice');
              $order-&gt;courier = $request-&gt;input('courier');
              $order-&gt;courier_service = $request-&gt;input('courierService');
              $order-&gt;shippingcode = $request-&gt;input('shippingcode');
              $order-&gt;shipping_price = $request-&gt;input('shippingPrice');
              $order-&gt;address = $address-&gt;address;
              $order-&gt;kecamatan = $address-&gt;kecamatan;
              $order-&gt;kelurahan = $address-&gt;kelurahan;
              $order-&gt;kota = $address-&gt;kota;
              $order-&gt;provinsi = $address-&gt;provinsi;
              $order-&gt;postalcode = $address-&gt;postalcode;
              $order-&gt;weight = $request-&gt;input('weight');
              $order-&gt;phone = $request-&gt;input('phone');
              $order-&gt;buyer_name = $user-&gt;name;
              $order-&gt;buyer_email = $user-&gt;email;
              $order-&gt;note = $request-&gt;input('note');
              $order-&gt;received = false;
              $order-&gt;save();
  
              // reduce stock of each product
              foreach ($cartItems as $item) {
                  $cartData = $item-&gt;cart_data;
                  $product = Product::find($cartData['productId']);
                  $product-&gt;decrement('qty', $cartData['quantity']);
              }
  
          } catch (Exception $e) {
              return response($e-&gt;getMessage(), 400);
          }
      }
  }
  </code></pre>
  <blockquote>
  <p>Note: I've tested <code>dd</code> every single data that I placed in <code>order</code> column and all are getting true values.</p>
  </blockquote>
  <p><strong>Any idea?</strong></p>