I\'m trying to convert a query to an array with the method toArray() but it doesn\'t work for the query builder. Any ideas for convert it?
toArray()
Example
toArray is a model method of Eloquent, so you need to a Eloquent model, try this:
User::where('name', '=', 'Jhon')->get()->toArray();
http://laravel.com/docs/eloquent#collections