Level 122
Model::where('something',$something)->pluck('id');
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How do I query a table for only the ID, and have it return an array without keys, and only the IDs. For example, I want an array like 1, 2, 3, 65, 77, 190, 234 .....
Thanks
Model::where('something',$something)->pluck('id');
Please or to participate in this conversation.