Laravel rename collection keys

前端 未结 0 428
眼角桃花
眼角桃花 2021-01-04 04:01

I have the following line to get an array of collections:

    $tags=Tag::all()->map->only([\'id\', \'name\']);

Which produces following

相关标签:
回答
  • 消灭零回复
提交回复
热议问题