【发布时间】:2018-10-14 11:33:21
【问题描述】:
来自 laravel 文档: withoutWrapping 方法只影响最外层的响应,不会删除您手动添加到自己的资源集合中的数据键。
我使用 Resource::withoutWrapping();
`"status": "success"
"entry": {
"access_control": [
1 => {
"allowed": [
0 => "015"
1 => "002"
2 => "011"
]
}`
在 laravel 5.6 中我无法定义自定义数组键,access_control 键下的键变为 0。'
如何让api资源支持自定义key?
【问题讨论】: