title: Laravel Polymorphic Database Seeder Factory
body: <p>How can I create a database seeder factory for the following configuration?</p>
  
  <p><strong>User</strong></p>
  
  <pre><code>// create_users_table.php
  Schema::create('users', function (Blueprint $table) {
      $table-&gt;increments('id');
      ...
  }
  
  // User.php
  public function notes()
  {
      return $this-&gt;morphMany('App\Note', 'noteable');
  }
  </code></pre>
  
  <p><strong>Complex</strong></p>
  
  <pre><code>// create_complex_table.php
  Schema::create('complex', function (Blueprint $table) {
      $table-&gt;increments('id');
      ...
  }
  
  // Complex.php
  public function notes()
  {
      return $this-&gt;morphMany('App\Note', 'noteable');
  }
  </code></pre>
  
  <p><strong>Notes</strong></p>
  
  <pre><code>// create_notes_table.php
  Schema::create('notes', function (Blueprint $table) {
      $table-&gt;increments('id');
      $table-&gt;integer('noteable_id');
      $table-&gt;string('noteable_type');
      ...
  }
  
  // Note.php
  public function noteable()
  {
      return $this-&gt;morphTo();
  }
  </code></pre>
  
  <p>I am struggling to see the most robust way of ensuring that I am not just filling in random <code>id</code>'s that may not exist.</p>