Skip to content

Commit 64e1645

Browse files
authored
Show request status as badge (#1736)
1 parent bd7a687 commit 64e1645

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

config/debugbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
'route' => false, // Current route information
172172
'auth' => false, // Display Laravel authentication status
173173
'gate' => true, // Display Laravel Gate checks
174-
'session' => true, // Display session data
174+
'session' => false, // Display session data
175175
'symfony_request' => true, // Only one can be enabled..
176176
'mail' => true, // Catch mail messages
177177
'laravel' => true, // Laravel version and environment

src/DataCollector/RequestCollector.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ public function getWidgets()
7272
"widget" => "PhpDebugBar.Widgets.HtmlVariableListWidget",
7373
"map" => "request.data",
7474
"default" => "{}"
75+
],
76+
'request:badge' => [
77+
"map" => "request.badge",
78+
"default" => ""
7579
]
7680
];
7781

@@ -200,7 +204,8 @@ public function collect()
200204

201205
return [
202206
'data' => $htmlData + $data,
203-
'tooltip' => array_filter($tooltip)
207+
'tooltip' => array_filter($tooltip),
208+
'badge' => $statusCode >= 300 ? $data['status'] : null,
204209
];
205210
}
206211

0 commit comments

Comments
 (0)