Giter Club home page Giter Club logo

Comments (9)

pyr0hu avatar pyr0hu commented on May 3, 2024 2

What if the package would provide events when a query is inefficient, so we could listen for that event and do what we want with that information? Like, I could connect it to Sentry/BugSnag/etc, or connect PHPUnit to automatically fail if one of the queries is not using eager loading.

What do you guys think?

from laravel-query-detector.

mpociot avatar mpociot commented on May 3, 2024

You could use the Log output and just look into the log files to see the detected N+1 queries.

from laravel-query-detector.

johannesschobel avatar johannesschobel commented on May 3, 2024

yeah, but if you run the application you would need to take a look at the Log file.. This would slow down "development" speed, i think.. For the regular "Web UI" you have a JavaScript Alert Box which immediately tells you, "what went wrong"..

Would be cool to have this for JSON as well..
I am thinking of something like "add a custom JSON to the JSON response".. What do you think about this?

from laravel-query-detector.

johannesschobel avatar johannesschobel commented on May 3, 2024

I think this would be a very cool Output feature :) I like the idea

from laravel-query-detector.

mpociot avatar mpociot commented on May 3, 2024

Yeah, Event could be another output format.
Does anyone want to PR this feature?

from laravel-query-detector.

pyr0hu avatar pyr0hu commented on May 3, 2024

I'll try to come up with something tomorrow :)

from laravel-query-detector.

mpociot avatar mpociot commented on May 3, 2024

Okay Great. Thinking about it - I would probably just fire the events all the time. Don’t think there’s a need to have this as an output method. If you want to listen for these events you can do it.

from laravel-query-detector.

Gennnji avatar Gennnji commented on May 3, 2024

Maybe, it would be great to implement Output class integrated with Clockwork?

from laravel-query-detector.

marcmascort avatar marcmascort commented on May 3, 2024

I created a Json output for APIs: #25

from laravel-query-detector.

Related Issues (20)

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.