Comments (7)
maybe better something like return Response::make($data)->withPaginator()->format('xml')
?
from api.
I'm trying to keep any sort of formatting related stuff outside of the
controller. The format is set via the Accept header.
On Fri, May 23, 2014 at 9:34 PM, Terion [email protected] wrote:
maybe better something like return
Response::make($data)->withPaginator()->format('xml')?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/63#issuecomment-44001189
.
from api.
I'm thinking this might also need to belong in Dingo\Api\Http\Response
so that if you are using closures for routes you can replace the Response
facade and use it much like was shown above.
return Response::withPaginator($paginator);
from api.
Sounds good. I only shoved them in the controller because it worked and I didn’t care about closures. Your way sounds better.
from api.
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. 😁
from api.
Sorry to bump you here mate, I know you've been working hard on Dingo. Where are we at?
from api.
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.
from api.
Related Issues (20)
- group 404 not fonund
- php artisan api:routes error on laravel 8 HOT 18
- Laravel Sanctum Auth
- Can't install in laravel6 HOT 2
- front-end when i call api then getting 405 Method Not Allowed HOT 3
- Missing required parameter for [Route: users.show] [URI: api/users/{id}] [Missing parameter: id]
- $api->resoure () report an error,flushMiddlewareGroups method not work HOT 1
- How to use middleware with multiple auth provider? HOT 3
- The version given was unknown or has no registered routes.
- Bug with PHPUnit coverage: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Dingo\Api\Contract\Routing\Adapter] is not instantiable while building [Dingo\Api\Routing\Router] HOT 1
- When declaring multiple resource routes, all but the first fail to pass the parameter correctly.
- In Handler.php line 67: Dingo\Api\Exception\Handler::__construct(): Argument #2 ($format) must be of type array, null given, called in /dingo/api/src/Provider/DingoServiceProvider.php on line 123 HOT 1
- $appends variables function got additional 3 times execution
- Djdnxb
- Ảnh
- Whether it will be updated HOT 1
- Getting this error "Unable to resolve transformer binding"
- API
- Laravel 9 issue while try to install dingo HOT 1
- #Luděk
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 api.