0

I use

$this->response->paginator($school, new SchoolTransformer());

to transform my data

but the result is not good.

{

"0": {

"id": 35,
"name": "北京东城大学",
"icon_url": "http://www.dicki.info/",
"area": "北京市 东城区",
"status": 1,
"count_users": 0

},

"meta": {

"pagination": {
  "total": 1,
  "count": 1,
  "per_page": 15,
  "current_page": 1,
  "total_pages": 1,
  "links": []
}

} }

how to remove "0" and "meta" stuff?

叶峰瑞
  • 1
  • 1
  • Possible duplicate of [Laravel : Dingo/API Pagination custom root key](http://stackoverflow.com/questions/41723858/laravel-dingo-api-pagination-custom-root-key) – Bilal Ahmed May 09 '17 at 13:22
  • It is resolved by using `$this->response->collection(collect($school->items()), new SchoolTransformer());` – 叶峰瑞 May 11 '17 at 12:18

0 Answers0