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 4
4
/*
5
5
* Enable or disable the query detection.
6
6
*/
7
- 'enabled ' => env ('QUERY_DETECTOR_ENABLED ' , false ),
7
+ 'enabled ' => env ('QUERY_DETECTOR_ENABLED ' , null ),
8
8
9
9
/*
10
10
* Here you can whitelist model relations.
21
21
],
22
22
23
23
/*
24
- * Define the output format that you want to use.
24
+ * Define the output formats that you want to use.
25
25
* Available options are:
26
26
*
27
27
* Alert:
32
32
* Writes the N+1 queries into the Laravel.log file
33
33
* \BeyondCode\QueryDetector\Outputs\Log::class
34
34
*/
35
- 'output ' => \BeyondCode \QueryDetector \Outputs \Alert::class,
36
-
35
+ 'output ' => [
36
+ \BeyondCode \QueryDetector \Outputs \Log::class,
37
+ \BeyondCode \QueryDetector \Outputs \Alert::class,
38
+ ]
37
39
];
Original file line number Diff line number Diff line change @@ -29,9 +29,13 @@ public function boot()
29
29
30
30
public function isEnabled (): bool
31
31
{
32
- $ config = config ('querydetector.enabled ' );
32
+ $ configEnabled = value ( config ('querydetector.enabled ' ) );
33
33
34
- return is_null ($ config ) ? false : $ config ;
34
+ if ($ configEnabled === null ) {
35
+ $ configEnabled = config ('app.debug ' );
36
+ }
37
+
38
+ return $ configEnabled ;
35
39
}
36
40
37
41
public function logQuery ($ query , Collection $ backtrace )
You can’t perform that action at this time.
0 commit comments