title: laravel4 update additional columns in pivot table
body: <p>I'm trying to update additional column data in a pivot table in a many to many relationship.</p>
  
  <p>I have two tables - reservation and resource linked with a pivot table. I can attach and am working with the model. However I'm struggling to update one of the additional columns in the pivot table.</p>
  
  <p>I have an object: '$reservation' From that object I created another object $resources using:</p>
  
  <pre><code>$resources = $reservation-&gt;resource()-&gt;get();
  </code></pre>
  
  <p>I'm then iterating through <code>$resources</code> using a <code>foreach</code> loop as follows</p>
  
  <pre><code>foreach($resources as $resource ) {...}
  </code></pre>
  
  <p>I then want to update a column called gcal_id and am using the following:</p>
  
  <pre><code>$resource-&gt;pivot-&gt;gcal_id = "TEST";
  $resource-&gt;save();
  </code></pre>
  
  <p>If I var_dump the model I can see the property exists to the correct value but in the database itself the entry is not being updated - so the save is not working</p>
  
  <p>I have the columns listed in both sides of the relationship with this:</p>
  
  <pre><code>-&gt;withPivot('start', 'end', 'quantity', 'product_id','gcal_id')
  </code></pre>
  
  <p>Given I have the resource object how can I update a column correctly in the pivot table and save to database?</p>
  
  <p>Thanks</p>