eloquent return only one column code example
Example 1: eloquent all only one culomn
$collection = collect([
['product_id' => 'prod-100', 'name' => 'Desk'],
['product_id' => 'prod-200', 'name' => 'Chair'],
]);
$plucked = $collection->pluck('name');
$plucked->all();
// ['Desk', 'Chair']
Example 2: eloquent get only some columns
Table::select('name','surname')->where('id', 1)->get();