Laravel: find out if variable is collection
<p>I want to find out if a variable is a collection.</p>

<p>I can't use is_object() because it will be true even if it is not an collection.
For now I use this, and it works:</p>

<pre><code>if(is_object($images) &amp;&amp; get_class($images) != 'Illuminate\Database\Eloquent\Collection') {
</code></pre>

<p>But I think it's so ugly that I spend time asking you about another solution.</p>

<p>Do you have any idea?</p>