dingo / dingo/api

laravel5.3 transform use question

Open
#1,423 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
9.4k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

I used laravel5.3 and has a question

```
return $this->collection($project, new ProjectTransformer());

// i get data
{
"data": [
{
"title": "品牌介绍",
"agency_id": 253,
"rank": 2,
"type": "系统",
"en_title": "brand-introduction"
},
{
"title": "成果展示",
"agency_id": 253,
"rank": 4,
"type": "系统",
"en_title": "demonstration-of-results"
}
]
}
```

I want to get this data and Piece together a new array,
```
{
"data": [
{
"title": "品牌介绍",
"agency_id": 253,
"rank": 2,
"type": "系统",
"en_title": "brand-introduction"
},
{
"title": "成果展示",
"agency_id": 253,
"rank": 4,
"type": "系统",
"en_title": "demonstration-of-results"
}
],
"status" : 1
}
```

how can i do that

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.