Laravel output:
Array
(
[0] = stdClass Object
(
[ID] = 5
)
[1] = stdClass Object
(
[ID] = 4
)
)
this worked for me in laravel 5.4
$partnerProfileIds = DB::table('partner_profile_extras')->get()->pluck('partner_profile_id');
$partnerProfileIdsArray = $partnerProfileIds->all();
output
array:4 [▼
0 => "8219c678-2d3e-11e8-a4a3-648099380678"
1 => "28459dcb-2d3f-11e8-a4a3-648099380678"
2 => "d5190f8e-2c31-11e8-8802-648099380678"
3 => "6d2845b6-2d3e-11e8-a4a3-648099380678"
]
https://laravel.com/docs/5.4/collections#method-all
$foo = Bar::getBeers(); $foo = $foo->toArray();