laravel map出来的数组要怎么去掉id呢?
return $allCategories
...
->map(function (MerchantGoodsCategory $category) use ($allCategories) {
$data = ['id' => $category->id, 'text' => $category->name, 'value' => $category->path];
...
});
map出来的数据会把id加在前面,怎么把这id去掉,而且变成一个数组呢?不要对象
推荐文章: