Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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']
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #eloquent #culomn
ADD COMMENT
Topic
Name
8+3 =