title: Argument 1 passed to Illuminate\Database\Eloquent\Builder::create() must be of the type array
body: <p>I have a model I plan to save the input to two different tables but I have an error</p>
  
  <blockquote>
    <p>Symfony\Component\Debug\Exception\FatalThrowableError Argument 1
    passed to Illuminate\Database\Eloquent\Builder::create() must be of
    the type array, object given, called in
    C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Support\Traits\ForwardsCalls.php
    on line 23</p>
  </blockquote>
  
  <p>the first table is <code>Transaction_in</code> and the second is <code>Transaction_in_detail</code>. I planned to use <code>idTransaction_in</code> as a connector between 2 tables and that column is not a primaryKey (is it a good practice)? I can save the input to <code>Transcation_in</code> table but still failed to save the input to the 2nd table and I don't know how to make the <code>idTransaction_in</code> column as a connector.</p>
  
  <pre><code>public function store(Request $request)
  {
      $request-&gt;validate([
          'supplier_name' =&gt; 'required',
          'transaction_in_date' =&gt; 'required|before_or_equal:today',
          'device_type_name' =&gt; 'required',
          'device_brand_name' =&gt; 'required',
          'device_spec' =&gt; 'required|max:255',
          'price' =&gt; 'required',
          'amount' =&gt; 'required',
          'total_price' =&gt; 'required',
          'keterangan' =&gt; 'Nullable',
  
          ]);
  
  
      $transaction_in = new Transaction_in();
      $transaction_in-&gt;idTransaction_in = "0";
      $transaction_in-&gt;Supplier_id = $request-&gt;input('supplier_name');
      $transaction_in-&gt;tanggal_transaksi = $request-&gt;input('transaction_in_date');
      $transaction_in-&gt;save();
      $transaction_in-&gt;update(['idTransaction_in' =&gt; sprintf('TIN-%04d', $transaction_in-&gt;id)]);
  
      $lastid=Transaction_in::create($transaction_in)-&gt;idTransaction_in;
      if(count($request-&gt;device_type_name)&gt;0){
          foreach ($request-&gt;device_type_name as $item =&gt; $v) {
              $data2=array(
                  'Transaction_in_id' =&gt; $lastid,
                  'DeviceType_id' =&gt; $request-&gt;device_type_name[$item],
                  'DeviceBrand_id' =&gt; $request-&gt;device_brand_name[$item],
                  'spek_device' =&gt; $request-&gt;device_spec[$item],
                  'harga_device' =&gt; $request-&gt;price[$item],
                  'jumlah_device' =&gt; $request-&gt;amount[$item],
                  'total_harga_device' =&gt; $request-&gt;total_price[$item]
              );
              Transaction_in_detail::insert($data2);
          }
      }
  
      return redirect('/transactionsin')-&gt;with('success', 'Transaction success');
  }
  </code></pre>
  
  <p>The <code>DeviceType_id</code> and <code>Devicebrand_id</code> are foreign key.</p>