Get an array of integer with Laravel query builder <p>I have this query :</p> <pre><code>$inError = DB::table('errors') -&gt;select('fk_fact') -&gt;distinct() -&gt;get(); </code></pre> <p>And I want it to return an array of integers instead of returning an array of objects, I don't want to loop over all the results and push the values one by one... Is there a way to do this with Laravel? </p>