select one column laravel 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: get single column value in laravel eloquent
Vehicle::find(3)->value('register_number');
Example 3: eloquest how to select one specific column in database
Model::where('id', 1)
->pluck('name', 'surname')
->all();