@@ -161,25 +161,21 @@ public function boot(){
161
161
$ this ->addCollector (new MessagesCollector ('events ' ));
162
162
$ dispatcher = $ this ->app ['events ' ];
163
163
$ dispatcher ->listen ('* ' , function () use ($ debugbar , $ dispatcher ){
164
- if ($ debugbar ->isEnabled ()){
165
- if (method_exists ($ dispatcher , 'firing ' )){
166
- $ event = $ dispatcher ->firing ();
167
- }else {
168
- $ args = func_get_args ();
169
- $ event = end ($ args );
170
- }
171
- $ debugbar ['events ' ]->info ("Received event: " . $ event );
164
+ if (method_exists ($ dispatcher , 'firing ' )){
165
+ $ event = $ dispatcher ->firing ();
166
+ }else {
167
+ $ args = func_get_args ();
168
+ $ event = end ($ args );
172
169
}
170
+ $ debugbar ['events ' ]->info ("Received event: " . $ event );
173
171
});
174
172
}
175
173
176
174
if ($ this ->shouldCollect ('views ' , true ) and isset ($ this ->app ['events ' ])){
177
175
$ collectData = $ this ->app ['config ' ]->get ('laravel-debugbar::config.options.views.data ' , true );
178
176
$ this ->addCollector (new ViewCollector ($ collectData ));
179
177
$ this ->app ['events ' ]->listen ('composing:* ' , function ($ view ) use ($ debugbar ){
180
- if ($ debugbar ->isEnabled ()){
181
- $ debugbar ['views ' ]->addView ($ view );
182
- }
178
+ $ debugbar ['views ' ]->addView ($ view );
183
179
});
184
180
}
185
181
@@ -197,13 +193,11 @@ public function boot(){
197
193
$ this ['messages ' ]->aggregate ($ logger );
198
194
$ this ->app ['log ' ]->listen (function ($ level , $ message , $ context ) use ($ debugbar , $ logger )
199
195
{
200
- if ($ debugbar ->isEnabled ()){
201
- if (is_array ($ message ) or is_object ($ message )){
202
- $ message = json_encode ($ message );
203
- }
204
- $ log = '[ ' .date ('H:i:s ' ).'] ' . "LOG. $ level: " . $ message . (!empty ($ context ) ? ' ' .json_encode ($ context ) : '' );
205
- $ logger ->addMessage ($ log , $ level );
196
+ if (is_array ($ message ) or is_object ($ message )){
197
+ $ message = json_encode ($ message );
206
198
}
199
+ $ log = '[ ' .date ('H:i:s ' ).'] ' . "LOG. $ level: " . $ message . (!empty ($ context ) ? ' ' .json_encode ($ context ) : '' );
200
+ $ logger ->addMessage ($ log , $ level );
207
201
});
208
202
}else {
209
203
$ this ->addCollector (new MonologCollector ( $ this ->app ['log ' ]->getMonolog () ));
@@ -227,9 +221,7 @@ public function boot(){
227
221
228
222
$ db ->listen (function ($ query , $ bindings , $ time , $ connectionName ) use ($ debugbar , $ queryCollector )
229
223
{
230
- if ($ debugbar ->isEnabled ()){
231
- $ queryCollector ->addQuery ($ query , $ bindings , $ time , $ connectionName );
232
- }
224
+ $ queryCollector ->addQuery ($ query , $ bindings , $ time , $ connectionName );
233
225
});
234
226
}
235
227
0 commit comments