Git Product home page Git Product logo

Comments (20)

mlanin avatar mlanin commented on July 17, 2024 2

@alvincrisuy My bad. In 5.4 events system was slightly changed. I'll update to 5.4 soon.

from laravel-api-debugger.

mlanin avatar mlanin commented on July 17, 2024 1

@alvincrisuy released a version for 5.4. You can use it now! ;)

from laravel-api-debugger.

mlanin avatar mlanin commented on July 17, 2024

@jonagoldman you mean sql log?

from laravel-api-debugger.

jonagoldman avatar jonagoldman commented on July 17, 2024

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.

mlanin avatar mlanin commented on July 17, 2024

Have you done everything written in the readme? Especially in the Installation section?

from laravel-api-debugger.

jonagoldman avatar jonagoldman commented on July 17, 2024

Yes.

  1. 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.

mlanin avatar mlanin commented on July 17, 2024

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.

mlanin avatar mlanin commented on July 17, 2024

Also can you please show me how you return data from your controller?

from laravel-api-debugger.

marceux avatar marceux commented on July 17, 2024

I'm having the same issue. As of right now, I'm returning Models directly in my controllers

from laravel-api-debugger.

mlanin avatar mlanin commented on July 17, 2024

@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.

ivanlolivier avatar ivanlolivier commented on July 17, 2024

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.

mlanin avatar mlanin commented on July 17, 2024

@ivanlolivier what kind of response do you return in your controller method?

from laravel-api-debugger.

ivanlolivier avatar ivanlolivier commented on July 17, 2024

@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.

mlanin avatar mlanin commented on July 17, 2024

@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.

ivanlolivier avatar ivanlolivier commented on July 17, 2024

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.

Andreyco avatar Andreyco commented on July 17, 2024

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.

alvincrisuy avatar alvincrisuy commented on July 17, 2024

@mlanin How can I make it work in 5.4?

from laravel-api-debugger.

mlanin avatar mlanin commented on July 17, 2024

@alvincrisuy you can use ^0.2.0 version

from laravel-api-debugger.

jonagoldman avatar jonagoldman commented on July 17, 2024

now its working for me

from laravel-api-debugger.

mlanin avatar mlanin commented on July 17, 2024

@jonagoldman good luck in debugging! :)

from laravel-api-debugger.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.