File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
The Laravel N+1 query detector helps you increase your application's performance by reducing the number of queries it executed.
9
9
This package will monitor your queries while you develop your application and notify you when you should add eager loading (N+1 queries).
10
-
10
+
11
+ ![ Example alert] ( https://beyondco.de/github/n+1/alert.png )
11
12
12
13
## Installation
13
14
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ protected function getOutputContent(Collection $detectedQueries)
32
32
$ output = '<script type="text/javascript"> ' ;
33
33
$ output .= "alert('Found the following N+1 queries in this request: \\n \\n " ;
34
34
foreach ($ detectedQueries as $ detectedQuery ) {
35
- $ output .= "Model: " .addslashes ($ detectedQuery ['model ' ]). " => Relation: " .addslashes ($ detectedQuery ['relation ' ])."\\n " ;
35
+ $ output .= "Model: " .addslashes ($ detectedQuery ['model ' ]). " => Relation: " .addslashes ($ detectedQuery ['relation ' ]);
36
+ $ output .= " - You should add \"with(\' " .$ detectedQuery ['relation ' ]."\') \" to eager-load this relation. " ;
37
+ $ output .= "\\n " ;
36
38
}
37
39
$ output .= "') " ;
38
40
$ output .= '</script> ' ;
You can’t perform that action at this time.
0 commit comments