Comments (9)
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.
You could use the Log output and just look into the log files to see the detected N+1 queries.
from laravel-query-detector.
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.
I think this would be a very cool Output
feature :) I like the idea
from laravel-query-detector.
Yeah, Event
could be another output format.
Does anyone want to PR this feature?
from laravel-query-detector.
I'll try to come up with something tomorrow :)
from laravel-query-detector.
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.
Maybe, it would be great to implement Output class integrated with Clockwork?
from laravel-query-detector.
I created a Json output for APIs: #25
from laravel-query-detector.
Related Issues (20)
- Wrong relation name suggested? HOT 4
- False detection when using count? HOT 1
- Ability to disable? HOT 2
- Question: Is it possible for warning to be suppressed for package code? HOT 2
- Laravel 8.x Compatibility
- In Batch request it is not work properly.
- does this package make sense for cli only scripts ?
- Incompatibility with Laravel 8 HOT 2
- Please allow PHP 8 HOT 2
- False Positive N+1 Queries
- Error "Argument #2 ($concrete) must be of type Closure|string|null" after install HOT 11
- Call to undefined method Illuminate\Foundation\Application::output()
- How to solve this error? HOT 2
- Issue when relation more than one same relation and no results. HOT 2
- Empty Object will be converted to empty array
- Add support for Laravel 9
- ErrorException QueryDetector.php:78 HOT 1
- Should we need to truncate the queries after out put the queries?
- Can't install the package in Laravel 10 HOT 1
- Undefined offset: 0 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-query-detector.