title: Saving/updating one to many relationships in Laravel
body: <p>I'm wondering what the best approach is when saving (for the first time) or updating one-to-many relationships with Laravel.</p>
  
  <p>At a simple level I have a <code>Person</code> model which can have multiple <code>Appointment</code> models associated to it. These relationships are established on the models themselves, but now I need to be able to;</p>
  
  <ul>
  <li>Display them when editing a <code>Person</code></li>
  <li>Allow them to be saved in the first instance</li>
  <li>Allow them to be updated in future</li>
  </ul>
  
  <p>The tricky part is that I want them to be embedded within the form for editing the <code>Person</code> itself, rather than on a separate page. So, the fields for the <code>Appointment</code>s are shown within an expandable table, in the middle of the <code>Person</code> form.</p>
  
  <p>So far I've managed to send the form data in a way which means I get an array which contains the full details of the <code>Appointment</code> models, which I could probably convert into <code>Appointment</code> models and then save them. It doesn't feel very elegant though, and I'm thinking there is probably a much better way to do this.</p>