Comments (4)
laravel 5.5 ?并不需要定义在 kernel 中,你把你的环境信息描述一下
from dingo-serializer-switch.
@liyu001989 laravel 5.5.40
from dingo-serializer-switch.
代码看着没有问题,检查是不是有路由缓存
https://github.com/summerblue/larabbs 开源项目 api 分支你自己对比一下
from dingo-serializer-switch.
也不是很熟悉dingo @liyu001989 一开始我也觉得好像没生效 代码这么写的:
return $this->response->collection($messages, new MessageTransformer);
但 更具 dingo 的这行 改 resourceKey
https://github.com/dingo/api/blob/master/src/Transformer/Adapter/Fractal.php#L152
和
fractal 的这行改 serializer
https://github.com/thephpleague/fractal/blob/master/src/Serializer/ArraySerializer.php#L30
其实应该这么写
return $this->response->collection($messages, new MessageTransformer, ['key' => 'forbar']);
from dingo-serializer-switch.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dingo-serializer-switch.