Skip to content

Commit 722c45c

Browse files
authored
Merge pull request #84 from noplanman/fix-console-output
Add slashes to relation strings in console output
2 parents a24ced7 + 27a86e8 commit 722c45c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Outputs/Console.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ protected function getOutputContent(Collection $detectedQueries)
4242
$output .= "console.warn('Found the following N+1 queries in this request:\\n\\n";
4343
foreach ($detectedQueries as $detectedQuery) {
4444
$output .= "Model: ".addslashes($detectedQuery['model'])." => Relation: ".addslashes($detectedQuery['relation']);
45-
$output .= " - You should add \"with(\'".$detectedQuery['relation']."\')\" to eager-load this relation.";
45+
$output .= " - You should add \"with(\'".addslashes($detectedQuery['relation'])."\')\" to eager-load this relation.";
4646
$output .= "\\n\\n";
4747
$output .= "Model: ".addslashes($detectedQuery['model'])."\\n";
48-
$output .= "Relation: ".$detectedQuery['relation']."\\n";
48+
$output .= "Relation: ".addslashes($detectedQuery['relation'])."\\n";
4949
$output .= "Num-Called: ".$detectedQuery['count']."\\n";
5050
$output .= "\\n";
5151
$output .= 'Call-Stack:\\n';

0 commit comments

Comments
 (0)