title: Saving data from dynamic form in Laravel
body: <p>I have been trying to save data from dynamic form in Laravel 5.3. But I cannot save it as array. The error shows</p>
  
  <blockquote>
    <p>Argument 1 passed to Illuminate\Database\Grammar::parameterize() must be of the type array, string given...</p>
  </blockquote>
  
  <p>Form:</p>
  
  <pre><code>&lt;select class="form-control-sm" name="client_id[]"&gt;
  &lt;input type="text" class="form-control-sm" name="amount[]"&gt;
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>protected $fillable = ['client_id', 'amount'];
  
  public function client()
  {
      return $this-&gt;belongsTo('App\Client');
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public function store(Request $request)
  {
      $count = Client::count();
  
      $payment = Payment::create(['amount' =&gt; $request-&gt;amount,
                                   'client_id'  =&gt; $request-&gt;client_id,
                                   ]);
      $payment-&gt;save();
  
      return redirect()-&gt;action('PaymentController@index');
  }
  </code></pre>
  
  <p>Please help on this. Thank you.</p>