SyntaxFix
Write A Post
Hire A Developer
Questions
From a Collection, another way you could do it would be:
Collection
$collection->pluck('id')->toArray()
This will return an indexed array, perfectly usable by laravel in a whereIn() query, for instance.
whereIn()