title: Call to a member function addEagerConstraints() on string
body: <p>I want to calculate the average of the column of nested morph relation.</p>
  <br>
  <br>
  <p><strong>Model Function</strong></p>
  <pre class="lang-php prettyprint-override"><code>public function trader_ratings()
  {
      return $this-&gt;morphMany(TraderRatings::class, 'rateable')
          -&gt;select('rateable_id', 'rateable_type', 'rating')
          -&gt;avg('rating');
  }
  </code></pre>
  <p><strong>Controller with lazy loading</strong></p>
  <pre class="lang-php prettyprint-override"><code>$user = auth('api')-&gt;user();
  $user_id = $user-&gt;id;
  $customer_classes = CustomerClassBooking::with([
      'trader_class',
      'trader_class.trader_ratings',
      'vendor',
  ])
      -&gt;where('customer_id', $user_id)
      -&gt;where('status', 'Accepted-paid')
      -&gt;get();
  </code></pre>
  <p>It is not calculating the <code>avg</code> but giving the error.</p>