File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 44 /*
55 * Enable or disable the query detection.
66 */
7- 'enabled ' => env ('QUERY_DETECTOR_ENABLED ' , false ),
7+ 'enabled ' => env ('QUERY_DETECTOR_ENABLED ' , null ),
88
99 /*
1010 * Here you can whitelist model relations.
2121 ],
2222
2323 /*
24- * Define the output format that you want to use.
24+ * Define the output formats that you want to use.
2525 * Available options are:
2626 *
2727 * Alert:
3232 * Writes the N+1 queries into the Laravel.log file
3333 * \BeyondCode\QueryDetector\Outputs\Log::class
3434 */
35- 'output ' => \BeyondCode \QueryDetector \Outputs \Alert::class,
36-
35+ 'output ' => [
36+ \BeyondCode \QueryDetector \Outputs \Log::class,
37+ \BeyondCode \QueryDetector \Outputs \Alert::class,
38+ ]
3739];
Original file line number Diff line number Diff line change @@ -29,9 +29,13 @@ public function boot()
2929
3030 public function isEnabled (): bool
3131 {
32- $ config = config ('querydetector.enabled ' );
32+ $ configEnabled = value ( config ('querydetector.enabled ' ) );
3333
34- return is_null ($ config ) ? false : $ config ;
34+ if ($ configEnabled === null ) {
35+ $ configEnabled = config ('app.debug ' );
36+ }
37+
38+ return $ configEnabled ;
3539 }
3640
3741 public function logQuery ($ query , Collection $ backtrace )
You can’t perform that action at this time.
0 commit comments