Eloquent select with() based on foreign key
<p>I have a table with user data (<code>users</code>) and a table with prices (<code>prices</code>). 
My prices table can contain multiple prices pr. user since I want to keep historical data.</p>

<p>I've defined my relation as a one-to-one </p>

<pre><code>$this-&gt;hasOne("App\Model\Price","userid","id")-&gt;orderBy("id","desc")-&gt;take(1);
</code></pre>

<p>to allow me to see the users current price.</p>

<p><strong>What I want to do now, is to select every user that has a current price of 100, but how do I do this?</strong> I know I could go for a left join, but as I read the documentation, it should be possible without a left join.</p>

<p>I've built a pseudo-query to explain what I'm after;
<code>User::with("price")-&gt;where("prices.price","100")-&gt;get();</code></p>

<p>I've read through the documentation (<a href="https://laravel.com/docs/5.3/eloquent-relationships#querying-relations" rel="nofollow noreferrer">Eloquent: Querying relationships</a>), but that doesn't seem to be useful to my question.</p>

<p>I've also read several questions here on SO but unfortunately to no avail.</p>