Answers for "laravel collection pull"

PHP
0

laravel collection pull

$collection = collect(['product_id' => 'prod-100', 'name' => 'Desk']);

$collection->pull('name');

// 'Desk'

$collection->all();

// ['product_id' => 'prod-100']
Posted by: Guest on July-24-2021

Browse Popular Code Answers by Language