You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+73-45Lines changed: 73 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,82 +41,104 @@ It also provides a Facade interface for easy logging Messages, Exceptions and Ti
41
41
42
42
Require this package with composer:
43
43
44
-
composer require barryvdh/laravel-debugbar
44
+
```
45
+
composer require barryvdh/laravel-debugbar
46
+
```
45
47
46
48
After updating composer, add the ServiceProvider to the providers array in app/config/app.php
47
49
48
-
'Barryvdh\Debugbar\ServiceProvider',
49
-
50
+
```
51
+
'Barryvdh\Debugbar\ServiceProvider',
52
+
```
53
+
50
54
If you want to use the facade to log messages, add this to your facades in app.php:
51
55
52
-
'Debugbar' => 'Barryvdh\Debugbar\Facade',
56
+
```
57
+
'Debugbar' => 'Barryvdh\Debugbar\Facade',
58
+
```
53
59
54
60
~~You need to publish the assets from this package.~~ Since 1.7, you don't need to publish the assets anymore.
55
61
56
62
The profiler is enabled by default, if you have app.debug=true. You can override that in the config files.
57
63
You can also set in your config if you want to include/exclude the vendor files also (FontAwesome, Highlight.js and jQuery). If you already use them in your site, set it to false.
58
64
You can also only display the js of css vendors, by setting it to 'js' or 'css'. (Highlight.js requires both css + js, so set to `true` for syntax highlighting)
You can also disable/enable the loggers you want. You can also use the IoC container to add extra loggers. (`$app['debugbar']->addCollector(new MyDataCollector)`)
63
71
64
72
You can now add messages using the Facade (when added), using the PSR-3 levels (debug, info, notice, warning, error, critical, alert, emergency):
By default, the Debugbar is injected just before `</body>`. If you want to inject the Debugbar yourself,
108
126
set the config option 'inject' to false and use the renderer yourself and follow http://phpdebugbar.com/docs/rendering.html
109
127
110
-
$renderer = Debugbar::getJavascriptRenderer();
128
+
```php
129
+
$renderer = Debugbar::getJavascriptRenderer();
130
+
```
111
131
112
132
Note: Not using the auto-inject, will disable the Request information, because that is added After the response.
113
133
You can add the default_request datacollector in the config as alternative.
114
134
115
135
## Enabling/Disabling on run time
116
136
You can enable or disable the debugbar during run time.
117
137
118
-
\Debugbar::enable();
119
-
\Debugbar::disable();
138
+
```php
139
+
\Debugbar::enable();
140
+
\Debugbar::disable();
141
+
```
120
142
121
143
NB. Once enabled, the collectors are added (and could produce extra overhead), so if you want to use the debugbar in production, disable in the config and only enable when needed.
122
144
@@ -127,18 +149,24 @@ Laravel Debugbar comes with two Twig Extensions. These are tested with [rcrowe/T
127
149
128
150
Add the following extensions to your TwigBridge config/extensions.php (or register the extensions manually)
129
151
130
-
'Barryvdh\Debugbar\Twig\Extension\Debug',
131
-
'Barryvdh\Debugbar\Twig\Extension\Dump',
132
-
'Barryvdh\Debugbar\Twig\Extension\Stopwatch',
152
+
```php
153
+
'Barryvdh\Debugbar\Twig\Extension\Debug',
154
+
'Barryvdh\Debugbar\Twig\Extension\Dump',
155
+
'Barryvdh\Debugbar\Twig\Extension\Stopwatch',
156
+
```
133
157
134
158
The Dump extension will replace the [dump function](http://twig.sensiolabs.org/doc/functions/dump.html) to output variables using the DataFormatter. The Debug extension adds a `debug()` function which passes variables to the Message Collector,
135
159
instead of showing it directly in the template. It dumps the arguments, or when empty; all context variables.
136
160
137
-
{{ debug() }}
138
-
{{ debug(user, categories) }}
161
+
```
162
+
{{ debug() }}
163
+
{{ debug(user, categories) }}
164
+
```
139
165
140
166
The Stopwatch extension adds a [stopwatch tag](http://symfony.com/blog/new-in-symfony-2-4-a-stopwatch-tag-for-twig) similar to the one in Symfony/Silex Twigbridge.
0 commit comments