title: How do you insert related polymorphic models in Laravel 4
body: <p>In Laravel 4 I have a "Meta" model that can be associated to any object via an "object_id" and "object_type" property.  For example:</p>
  
  <pre><code>id: 1
  object_id: 100
  object_type: User
  key: favorite_ice_cream
  value: Vanilla
  </code></pre>
  
  <p>I have this working correctly via morphTo() and morphMany() as described in <a href="http://laravel.com/docs/eloquent#polymorphic-relations" rel="noreferrer">http://laravel.com/docs/eloquent#polymorphic-relations</a>, so I can pull the user and all of his meta via:</p>
  
  <p>$user = User::with('meta')->find(100);</p>
  
  <p>What I'm trying to figure out now is: Is there an easy way to save meta to my user?  As in:</p>
  
  <pre><code>$user = User::find(100);
  $user-&gt;meta()-&gt;save(['key' =&gt; 'hair_color', 'value' = 'black']);
  </code></pre>
  
  <p>Whatever does the saving would need to properly set the object_id and object_type on the meta.  Since I've defined the relationships in the models, I'm not sure if that would be done automatically or not.  I randomly tried it a few different ways but it crashed each time.</p>