title: How can I get all records belonging to the model class as relation on a 1-M polymorphic relation
body: <p>I am trying to store statuses of multiple models in a polymorphic relationship and use them from there. </p>
  
  <p>The retrieving of the status works but besides that I need to get all (available) the statuses belonging to that specific model. And then eager load them so I can use them in a select form or somewhere else. </p>
  
  <p>Here is a representation:</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>// Status.php
  class Status extends Model
  {
      public function statusable()
      {
          return $this-&gt;morphTo();
      }
  }
  
  // Article.php
  class Article extends Model
  {
      public function status()
      {
          return $this-&gt;morphOne(Status::class, 'statusable', 'statusable_type', 'statusable_id', 'status');
      }
  }
  
  // Post.php
  class Post extends Model
  {
      public function status()
      {
          return $this-&gt;morphOne(Status::class, 'statusable', 'statusable_type', 'statusable_id', 'status');
      }
  }
  </code></pre>
  
  <p>Here I can get the status(details) of the selected model like <code>App\Article::first()-&gt;status()-&gt;get()</code> or eager load it as expected. What I want is to add a method where I can call (all) statuses that belong to that particular model. For example:</p>
  
  <pre class="lang-php prettyprint-override"><code>$article = App\Article::first()-&gt;statuses();
  </code></pre>
  
  <p>and then return all available statuses to this model. I can (did) of course create a method like:</p>
  
  <pre class="lang-php prettyprint-override"><code>// Article.php
  ...
  public function statuses()
  {
      $statuses = Status::where('statusable_type', self::class)-&gt;get();
      return $statuses;
  }
  </code></pre>
  
  <p>But this way I cant eager load it because I don't return a relationship. So is there a cleaner way where I can use eager loading as well?</p>