Laravel conditional on relation: return first()
<p>I have a <code>Laravel 5.2</code> <code>one-to-many relation</code> and I want to return the model and put a condition to relation.
I've tried this:</p>

<pre><code>$categories = Category::with(['descriptions' =&gt; function($d) use ($default_language) {
    $d-&gt;where('language_id', $default_language-&gt;id);
}])-&gt;get();
</code></pre>

<p>It work fine, I just want something else: the relation should not be a collection or array, just a simple object. I want to do something like</p>

<pre><code>$d-&gt;where('language_id', $default_language-&gt;id)-&gt;first();
</code></pre>

<p>, just in this case <code>first()</code> is not working. Any ideas?</p>

<p><strong>EDIT</strong>
Actually <code>first()</code> is not working properly, it returns first description just for the first object returned, for others it return nothing.</p>