Remove key data in dingo - fractal

ساخت وبلاگ

Vote count: 0

I already looked into several example on how to remove the key "data" in response, but i cannot fix it.

I tried to use the callback provided by dingo

retu $this->collection($users, new UserTransformer, function ($resource, $fractal) { $fractal->setSerializer(new ArraySerializer);
});

In change the "$fractal->setSerializer(new CustomSerializer);" to "$fractal->setSerializer(new ArraySerializer);" since I dont have CustomSerializer(And how to make this custom serializer?) based on the fractal documentation array serializer but the out put has the key "data".

I also tested the fractal library in different project and implementing the ArraySerializer as the Serializer, and it works.

What am I missing in the setup of dingo-fractal?

Thanks.

asked 52 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 316 تاريخ : دوشنبه 31 خرداد 1395 ساعت: 18:11