How to return an array instead of a collection in Laravel?
<p>In Laravel is it possible to select only one field and return that as a set/ array.</p>

<p>For example consider the model <code>Foo</code> which is linked to table <code>foos</code> which has field <code>id</code>, <code>a</code>, <code>b</code>, <code>c</code>.</p>

<p>Consider the following sample data:</p>

<pre><code>(1, 10, 15, 20)
(1, 12, 15, 27)
(1, 17, 15, 27)
(1, 25, 16, 29)
(1, 28, 16, 40)
</code></pre>

<p>Now if I wanted to create a query that returns all the values of <code>a</code> where <code>b</code> is <code>15</code>, I could do that like so:</p>

<pre><code>Foo::select('a')-&gt;where('b', 15)-&gt;get();
</code></pre>

<p>However this will return an eloquent collection.</p>

<p>Instead how can I return instead an array like this:</p>

<pre><code>[10, 12, 17]
</code></pre>