title: Attaching records to a Laravel hasManyThrough relation
body: <p>A simple and straight one:</p>
  
  <p>How can I <strong>attach or detach new records</strong> when using a Laravel <em>hasManyThrough</em> relation <em>the Laravel way</em>?
  Model retrieving is obvious, from the docs <a href="https://laravel.com/docs/eloquent-relationships#has-many-through" rel="nofollow noreferrer">here</a>.</p>
  
  <p><strong>EDIT</strong>: In other words, is there a <em>Laravelish way</em> of doing the following smarter (model names taken from docs)?</p>
  
  <pre><code>$user = $country-&gt;users()-&gt;first;
  $post-&gt;user_id = $user-&gt;id;
  $post-&gt;save();
  </code></pre>
  
  <p>Thanks in advance.</p>