title: Clarify how to setup a one-to-many relationship in Laravel's Eloquent ORM
body: <p>Okay, I'm working through the Laravel 4 docs to setup a one-to-many relationship between two models.  Obviously, one side should use hasMany().  But for the other side, should I use hasOne or belongsTo?  Does it matter?  What's difference?  Why do both exist?</p>
  
  <p>I had thought hasOne would be for one-to-one relationships, and belongsTo would be for the one side of one-to-many.  But in the docs, for inserting a related model here:</p>
  
  <p><a href="http://laravel.com/docs/eloquent#inserting-related-models" rel="noreferrer">http://laravel.com/docs/eloquent#inserting-related-models</a></p>
  
  <p>they are using <code>save()</code> which seems to only be present in <code>hasOne</code> and <code>hasMany</code> relationships, not in <code>belongsTo</code>.  It looks like <code>belongsTo</code> uses <code>associate()</code> for the same purpose:</p>
  
  <p><a href="https://github.com/laravel/framework/blob/master/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php#L188" rel="noreferrer">https://github.com/laravel/framework/blob/master/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php#L188</a></p>
  
  <p>Maybe I just need some general background on when to use <code>belongsTo</code> vs. <code>hasOne</code>, and why <code>belongsTo</code> uses <code>associate()</code> while <code>hasOne</code> uses <code>save()</code>.</p>
  
  <p>EDIT: I guess my point of confusion was that in the docs (<a href="http://laravel.com/docs/eloquent#inserting-related-models" rel="noreferrer">http://laravel.com/docs/eloquent#inserting-related-models</a>), they used:</p>
  
  <pre><code>$post-&gt;comments()-&gt;save($comment);
  </code></pre>
  
  <p>where I would have used:</p>
  
  <pre><code>$comment-&gt;post()-&gt;associate($post);
  </code></pre>
  
  <p>Is there an advantage to one way or the other?  Or is it just a question of what makes sense in the context?</p>