File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ class ServiceProvider extends BaseServiceProvider
13
13
*/
14
14
public function boot ()
15
15
{
16
+ // Obey the same rules of laravel debugbar so we do not enable profiling where is not expected too.
17
+ if (!$ this ->isEnabled ()) {
18
+ return ;
19
+ }
20
+
16
21
if ($ this ->app ->runningInConsole ()) {
17
22
$ this ->commands ([
18
23
Debug::class,
@@ -37,4 +42,18 @@ public function register()
37
42
{
38
43
$ this ->app ->register (DebugbarServiceProvider::class);
39
44
}
45
+
46
+ /**
47
+ * @return bool
48
+ */
49
+ protected function isEnabled ()
50
+ {
51
+ $ enabled = $ this ->app ['config ' ]->get ('debugbar.enabled ' );
52
+
53
+ if (is_null ($ enabled )) {
54
+ $ enabled = $ this ->app ['config ' ]->get ('app.debug ' );
55
+ }
56
+
57
+ return (bool ) $ enabled ;
58
+ }
40
59
}
You can’t perform that action at this time.
0 commit comments