Just use pluck() and ->toArray():
pluck()
->toArray()
Foo::where('b', 15)->pluck('a')->toArray();
Laravel's pluck() method.
Laravel's toArray() method.
The lists method is deprecated and pluck need some parameter so, if you want to get all the attributed in array format, use it this way.
Foo::select('a')->where('b', 15)->get()->all();
Do
Foo::where('b', 15)->lists('a')->all();
This will give you an array of ids. eg [2, 3, 5]