-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhauling Controller #63
Comments
maybe better something like |
I'm trying to keep any sort of formatting related stuff outside of the On Fri, May 23, 2014 at 9:34 PM, Terion notifications@github.com wrote:
|
I'm thinking this might also need to belong in return Response::withPaginator($paginator); |
Sounds good. I only shoved them in the controller because it worked and I didn’t care about closures. Your way sounds better. |
So I'm just looking at this now and I'm not too sure what these methods should be doing. I know in your case Phil you'd like to have more control over how Fractal is handled. For others though they might not want that. My train of thought at the moment is that simply allowing the "magic responses" to be disabled would be the best way forward, for now. That way you can still retain complete control over the responses that are returned. I may be thinking about this all wrong though. So. Much. Thinking. 😁 |
Sorry to bump you here mate, I know you've been working hard on Dingo. Where are we at? |
I know I prefer explicit responses whenever possible. In general I don't like the idea of too many layers doing things between the controller response and the actual response. A config switch, or supporting both, sound reasonable. |
Okay the plan is to overhaul the controller that the API ships with to provide a bunch of helper methods to easily return better responses.
Currently responses are kind of "magically" transformed. I'd like to keep that, but perhaps add a configuration option to disable it (perhaps by default?) so that you can return raw responses (in regards to #50) and also make use of the helper methods.
Possible helper methods:
withPaginator
withCollection
withModel
withArray
Usage would be:
Or something to that affect. Just after some thoughts and other possible methods.
/cc @philsturgeon
The text was updated successfully, but these errors were encountered: