title: Laravel Eloquent: Nested relationship and save data
body: <p>I have three models.</p>
  
  <pre><code>PERSON (hasOne(EMPLOYEE), hasMany(CHILDREN))
  id,
  name
  
  EMPLOYEE
  id,
  person_id
  
  CHILDREN
  id,
  person_id
  </code></pre>
  
  <p>I want to add a child to person model but i have access to EMPLOYEE_ID. I tried to code but it doesn't work.</p>
  
  <pre><code>$employee-&gt;person()-&gt;children()-&gt;save($child);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$employee-&gt;person()-&gt;children()-&gt;associate($child);
  </code></pre>
  
  <p>But both doesn't work. I don't know if this can be accomplished by just one line of code. </p>