Answers for "eloquent all only one culomn"

PHP
2

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']
Posted by: Guest on May-21-2020

Browse Popular Code Answers by Language