Eager Loading: Use `with` on pivot with eloquent relationship
<p>There are 4 tables:</p>

<ul>
<li><code>bundles</code>: id, name </li>
<li><code>products</code>: id, name</li>
<li><code>prices</code>: id, name</li>
<li><code>bundle_product</code>: id, bundle_id, product_id, price_id</li>
</ul>

<p>There are 3 models:</p>

<ul>
<li><code>Bundle</code></li>
<li><code>Product</code></li>
<li><code>Price</code></li>
</ul>

<p>A <code>Product</code> has a <code>Price</code> when in a <code>Bundle</code>. I want to have all <code>bundles</code> with their associated <code>products</code> <strong>and associated <code>prices</code>.</strong> I can get all bundles with their product and the price id:</p>

<pre><code>// I created a Bundle Model with a products method
class Bundle extends Model
{
    public function products()
    {
        return $this-&gt;belongsToMany(Product::class)-&gt;withPivot('price_id');
    }
}

// Then I call this in a controller
$all_bundles = Bundle::with('products')-&gt;get();

// Then I can get the price Id of the first product of the first bundle
$price_id = Bundle::with('products')-&gt;first()
    -&gt;products()-&gt;first()
    -&gt;pivot-&gt;price_id;
</code></pre>

<p>But I dont want the <em>price id</em>, I want the <em>price Model</em>. Is there any way to preload the price from the pivot (with Eager Loading)?</p>