title: Vue.js and Laravel update multiple rows with one call
body: <p>For a better understanding, here are two of my models.</p>
  
  <p><strong>Model for images</strong>:</p>
  
  <pre><code>class Image extends Model
  {
  
  ...    
  
      public function item()
      {
  
          return $this-&gt;belongsTo(Item::class);
      }
  }
  </code></pre>
  
  <p>Model an item:</p>
  
  <pre><code>class Item extends Model
  {
  
  ...    
  
      public function images()
      {
  
          return $this-&gt;hasMany(Image::class);
      }
  }
  </code></pre>
  
  <p>In my view I am using a mixture of laravel's blade engine and Vue.js which looks like this:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      &lt;label&gt;@lang('app.user.edit.images')&lt;/label&gt;
      &lt;div v-for="(img, index) in my.images"&gt;
          &lt;input type="text" name="images[]" class="form-control images" v-model="my.image"&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This gives my one input for any image of the item. By changing the value of each image I want to update all database. I do not know if it is a good practice to name the input like <code>name="images[]"</code> to get an array.</p>
  
  <p>My database table for images looks like this:</p>
  
  <pre><code>+----+---------+-------+------------+------------+
  | id | item_id | image | created_at | updated_at |
  +----+---------+-------+------------+------------+
  </code></pre>
  
  <p>Hopefully, some of you had the same problem in the past and can help me out.</p>