Comments (20)
@alvincrisuy My bad. In 5.4 events system was slightly changed. I'll update to 5.4 soon.
from laravel-api-debugger.
@alvincrisuy released a version for 5.4. You can use it now! ;)
from laravel-api-debugger.
@jonagoldman you mean sql log?
from laravel-api-debugger.
Yes, how to do what you show in the readme. Basically add "debug": { //some data }
to the JSON response of my API.
from laravel-api-debugger.
Have you done everything written in the readme? Especially in the Installation section?
from laravel-api-debugger.
Yes.
- get package 2) register service provider 3) add alias.
From what I read in the _Debugging_ section (I assume this is the "Usage" section), there is only one method: Debugger::dump($foo, $bar);
where $foo
is a string and $bar
an array. That's nice, but how do I get the SQL queries into my JSON response? How does that dump()
method comes into play?
from laravel-api-debugger.
Check please if your APP_DEBUG
set to true
. And what Laravel version do you use?
Debugger::dump();
method can receive any number of variables to dump. And they will be passed to debug.dump
json attribute in the output.
from laravel-api-debugger.
Also can you please show me how you return data from your controller?
from laravel-api-debugger.
I'm having the same issue. As of right now, I'm returning Models directly in my controllers
from laravel-api-debugger.
@marceux that's the problem. Your controller methods have to return JsonResponse
object in order to let package know that you are returning real JSON and not anything else.
So just use response()->json(['models' => [$model,...]]);
.
from laravel-api-debugger.
I have the same problem. The service provider is running but the debug section is not been added.
I'm using dingo. Is this a knowed problem?
from laravel-api-debugger.
@ivanlolivier what kind of response do you return in your controller method?
from laravel-api-debugger.
@mlanin First of all thanks for the response.
I'm using this:
return $this->response->item(User::findOrFail($id), new UserTransformer);
but also tried with:
response()->json(User::findOrFail($id))
and
response()->json(['user' => User::findOrFail($id)])
from laravel-api-debugger.
@ivanlolivier you have to return JsonResponse object. The easiest way to do it is to return response()->json(['data' => ... ])
.
What Laravel version do you use and check please that APP_DEBUG
is set to true
.
from laravel-api-debugger.
The APP_DEBUG
is already in true and I'm using laravel 5.2.
I'm going to try responding in that way. Thanks!
from laravel-api-debugger.
From my observations, debug data is appended to response when request is executed from browser. Response returned after request is made from Postman/Insomnia does not contain debug data. I suppose this is the case for any other REST client.
from laravel-api-debugger.
@mlanin How can I make it work in 5.4?
from laravel-api-debugger.
@alvincrisuy you can use ^0.2.0 version
from laravel-api-debugger.
now its working for me
from laravel-api-debugger.
@jonagoldman good luck in debugging! :)
from laravel-api-debugger.
Related Issues (18)
- Model name of database query HOT 1
- is there any way to return mongodb query in response? HOT 1
- Disabling not working HOT 2
- can't config with lumen framework HOT 2
- Does not display query if exception is thrown HOT 3
- PHP 7.4 error: "Object of class DateTime could not be converted to string HOT 7
- Binary UUid integration
- Crashes if the response is not an object HOT 1
- Argument 1 passed to ServiceProvider::registerCollections() must be of the type array, null given
- Enable / Disable Switch HOT 9
- Don't work with jenssegers/laravel-mongodb HOT 4
- Documentation is blurry
- Object of class DateTime could not be converted to string HOT 6
- It will crash if the response data is empty HOT 2
- Show total time queries. HOT 1
- Can you run it on the LUMEN with the DINGO API HOT 1
- Feature request, Sort by time HOT 1
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 laravel-api-debugger.