title: Manually inject model relation using Eloquent
body: <p>How can I add a model into the relations array of another model?</p>
  
  <p>E.g.</p>
  
  <ul>
  <li>Domain belongsTo Owner.</li>
  <li>Owner hasOne Domain.</li>
  <li>I have $domain (instance of Domain).</li>
  <li>I have $owner (instance of Owner).</li>
  </ul>
  
  <p>I want to add <code>$domain</code> to <code>$owner-&gt;relations[]</code> so that I can just use <code>$owner-&gt;domain</code> later on in my code.</p>
  
  <p>The reason for doing this is such that in one particular controller i only need a partial data set from each model so use fluent to query with a join for performance reasons then fill the models.</p>
  
  <p>Then for readability's sake I'd like to use <code>$owner-&gt;domain-&gt;id</code> etc</p>
  
  <p><code>$domain-&gt;owner()-&gt;associate($owner);</code> gives me a <code>$domain-&gt;owner</code> option</p>
  
  <p>But then I can't work out the opposite version</p>
  
  <pre><code>$owner-&gt;domain()-&gt;associate($domain)
  $owner-&gt;domain()-&gt;attach($domain)
  </code></pre>
  
  <p>both result in the following fatal error</p>
  
  <blockquote>
    <p>Call to undefined method Illuminate\Database\Query\Builder::[attach|associate] ()</p>
  </blockquote>
  
  <p><em>NB: I don't want to save anything as I've already loaded all the data i need.</em></p>