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 77
88The Laravel N+1 query detector helps you increase your application's performance by reducing the number of queries it executed.
99This 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 )
1112
1213## Installation
1314
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ protected function getOutputContent(Collection $detectedQueries)
3232 $ output = '<script type="text/javascript"> ' ;
3333 $ output .= "alert('Found the following N+1 queries in this request: \\n \\n " ;
3434 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 " ;
3638 }
3739 $ output .= "') " ;
3840 $ output .= '</script> ' ;
You can’t perform that action at this time.
0 commit comments