From 335f7dd5dd41b8c5c2769eb7c40a0480117d3626 Mon Sep 17 00:00:00 2001 From: Jan Piotrowski Date: Wed, 18 Jul 2018 18:48:13 +0200 Subject: [PATCH] Fix output of relationship name in advice part of alert Namespace \ was getting eaten. fixes part of #9 --- src/Outputs/Alert.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Outputs/Alert.php b/src/Outputs/Alert.php index e951d74..4171a33 100644 --- a/src/Outputs/Alert.php +++ b/src/Outputs/Alert.php @@ -37,7 +37,7 @@ protected function getOutputContent(Collection $detectedQueries) $output .= "alert('Found the following N+1 queries in this request:\\n\\n"; foreach ($detectedQueries as $detectedQuery) { $output .= "Model: ".addslashes($detectedQuery['model']). " => Relation: ".addslashes($detectedQuery['relation']); - $output .= " - You should add \"with(\'".$detectedQuery['relation']."\')\" to eager-load this relation."; + $output .= " - You should add \"with(\'".addslashes($detectedQuery['relation'])."\')\" to eager-load this relation."; $output .= "\\n"; } $output .= "')"; @@ -45,4 +45,4 @@ protected function getOutputContent(Collection $detectedQueries) return $output; } -} \ No newline at end of file +}