title: Method addEagerConstraints does not exist
body: <p>I have two models, User and Event. I made a pivot table, <code>invitations</code> between User and Event with a <code>status</code> column. In my Event model definition, I wrote this :</p>
  
  <pre><code>public function invited()
  {
      return $this-&gt;belongsToMany(User::class, 'invitations', 'event_id', 'user_id')
          -&gt;withTimestamps()
          -&gt;withPivot('status')
          -&gt;orderByDesc('invitations.updated_at');
  }
  
  public function participants()
  {
      $event = $this-&gt;with([
          'invited' =&gt; function ($query) {
              $query-&gt;where('invitations.status', InvitationStatus::ACCEPTED)-&gt;get();
          }
      ])-&gt;first();
  
      return $event-&gt;invited;
  }
  </code></pre>
  
  <p>But when in my controller I do :</p>
  
  <pre><code>$event = Event::where('id', $id)-&gt;with(['owner', 'participants'])-&gt;first();
  </code></pre>
  
  <p>I have the following error :</p>
  
  <pre><code>(1/1) BadMethodCallException
  Method addEagerConstraints does not exist.
  </code></pre>
  
  <p>Does someone know why?</p>