I need to get an array of a list of random ids from a model, I do:
User::all('id')->random(5)->flatten()->toArray()
But this still out a multi array:
0 => array:1 [
"id" => 20
]
1 => array:1 [
"id" => 69
]
....
Im looking for something like:
[20, 69]
Try
pluck()
: