Eager load model using with but giving it another name - Laravel 5.2 : <p>Is it possible to use eager loading using the with method but giving it another name? Something like:</p>

<pre><code>-&gt;with('documents as product', 'documents.documents as categories')
</code></pre>

<p>I have a documents table that can be product or categories, eager loading is working but not that friendly to retrieve the documents by just the document name instead of what it really is.</p>
