generated from host-uk/core-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
lang:phpPHP/LaravelPHP/Laravel
Description
Description
The Boot service provider enables query logging for all requests in local environment, regardless of whether it's needed.
Location
- File: src/Boot.php
- Lines: 40-43
Issue
The boot() method enables query logging unconditionally:
if (app environment is local) {
DB::enableQueryLog();
}
This:
- Consumes memory for every query in every request
- Even on requests that don't use the dev bar
- Can slow down requests with many queries
- Queries are never cleared, growing throughout the request
Recommendation
- Only enable query logging when the dev bar is actually being rendered
- Use middleware to enable logging only for requests that need it
- Add a config option to disable even in local environment
- Consider using Telescope's query recording instead (already installed)
Severity
Low - Only affects local development but can impact DX on complex pages
Metadata
Metadata
Assignees
Labels
lang:phpPHP/LaravelPHP/Laravel