Level 8
Update: I found a way to do it:
$plucked_column = ($paginated_data->items())->pluck('user_id');
Is there a better way to do it?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
Is it possible to get specific column as array from paginated data? For example:
$paginated_data = DB::table('table')->select('id', 'user_id', 'name', 'email')->paginate();
and somehow get the list of user_id's as array from that specific paginated page?
thanks
Please or to participate in this conversation.