title: Seeding a table that has multiple relationships?
body: <p>I have a comments table that <code>belongsTo</code> both a <code>user</code> table and an <code>article</code> table.</p>
  
  <p>How can the table be seeded so that both the <code>user</code> and <code>article</code> foreign key is complete?</p>
  
  <p>After looking through various examples, I found that you could seed the user then attach/save other models...</p>
  
  <pre><code>factory(User::class, 100)-&gt;create()-&gt;each(function ($user) {
  
  $articles = factory(Article::class, 5)-&gt;make();
  $user-&gt;article()-&gt;saveMany($articles);
  </code></pre>
  
  <p>But how can the same be done for comments with two foreign keys?</p>