Skip to content

Commit 1f110f9

Browse files
committed
debugbar: Add debuger & publish config
1 parent 8914c09 commit 1f110f9

File tree

2 files changed

+340
-0
lines changed

2 files changed

+340
-0
lines changed

config/debugbar.php

Lines changed: 338 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,338 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Debugbar Settings
8+
|--------------------------------------------------------------------------
9+
|
10+
| Debugbar is enabled by default, when debug is set to true in app.php.
11+
| You can override the value by setting enable to true or false instead of null.
12+
|
13+
| You can provide an array of URI's that must be ignored (eg. 'api/*')
14+
|
15+
*/
16+
17+
'enabled' => env('DEBUGBAR_ENABLED', null),
18+
'hide_empty_tabs' => env('DEBUGBAR_HIDE_EMPTY_TABS', false), // Hide tabs until they have content
19+
'except' => [
20+
'telescope*',
21+
'horizon*',
22+
],
23+
24+
/*
25+
|--------------------------------------------------------------------------
26+
| Storage settings
27+
|--------------------------------------------------------------------------
28+
|
29+
| Debugbar stores data for session/ajax requests.
30+
| You can disable this, so the debugbar stores data in headers/session,
31+
| but this can cause problems with large data collectors.
32+
| By default, file storage (in the storage folder) is used. Redis and PDO
33+
| can also be used. For PDO, run the package migrations first.
34+
|
35+
| Warning: Enabling storage.open will allow everyone to access previous
36+
| request, do not enable open storage in publicly available environments!
37+
| Specify a callback if you want to limit based on IP or authentication.
38+
| Leaving it to null will allow localhost only.
39+
*/
40+
'storage' => [
41+
'enabled' => env('DEBUGBAR_STORAGE_ENABLED', true),
42+
'open' => env('DEBUGBAR_OPEN_STORAGE'), // bool/callback.
43+
'driver' => env('DEBUGBAR_STORAGE_DRIVER', 'file'), // redis, file, pdo, socket, custom
44+
'path' => env('DEBUGBAR_STORAGE_PATH', storage_path('debugbar')), // For file driver
45+
'connection' => env('DEBUGBAR_STORAGE_CONNECTION', null), // Leave null for default connection (Redis/PDO)
46+
'provider' => env('DEBUGBAR_STORAGE_PROVIDER', ''), // Instance of StorageInterface for custom driver
47+
'hostname' => env('DEBUGBAR_STORAGE_HOSTNAME', '127.0.0.1'), // Hostname to use with the "socket" driver
48+
'port' => env('DEBUGBAR_STORAGE_PORT', 2304), // Port to use with the "socket" driver
49+
],
50+
51+
/*
52+
|--------------------------------------------------------------------------
53+
| Editor
54+
|--------------------------------------------------------------------------
55+
|
56+
| Choose your preferred editor to use when clicking file name.
57+
|
58+
| Supported: "phpstorm", "vscode", "vscode-insiders", "vscode-remote",
59+
| "vscode-insiders-remote", "vscodium", "textmate", "emacs",
60+
| "sublime", "atom", "nova", "macvim", "idea", "netbeans",
61+
| "xdebug", "espresso"
62+
|
63+
*/
64+
65+
'editor' => env('DEBUGBAR_EDITOR') ?: 'vscode',
66+
67+
/*
68+
|--------------------------------------------------------------------------
69+
| Remote Path Mapping
70+
|--------------------------------------------------------------------------
71+
|
72+
| If you are using a remote dev server, like Laravel Homestead, Docker, or
73+
| even a remote VPS, it will be necessary to specify your path mapping.
74+
|
75+
| Leaving one, or both of these, empty or null will not trigger the remote
76+
| URL changes and Debugbar will treat your editor links as local files.
77+
|
78+
| "remote_sites_path" is an absolute base path for your sites or projects
79+
| in Homestead, Vagrant, Docker, or another remote development server.
80+
|
81+
| Example value: "/home/vagrant/Code"
82+
|
83+
| "local_sites_path" is an absolute base path for your sites or projects
84+
| on your local computer where your IDE or code editor is running on.
85+
|
86+
| Example values: "/Users/<name>/Code", "C:\Users\<name>\Documents\Code"
87+
|
88+
*/
89+
90+
'remote_sites_path' => env('DEBUGBAR_REMOTE_SITES_PATH'),
91+
'local_sites_path' => env('DEBUGBAR_LOCAL_SITES_PATH'),
92+
93+
/*
94+
|--------------------------------------------------------------------------
95+
| Vendors
96+
|--------------------------------------------------------------------------
97+
|
98+
| Vendor files are included by default, but can be set to false.
99+
| This can also be set to 'js' or 'css', to only include javascript or css vendor files.
100+
| Vendor files are for css: font-awesome (including fonts) and highlight.js (css files)
101+
| and for js: jquery and highlight.js
102+
| So if you want syntax highlighting, set it to true.
103+
| jQuery is set to not conflict with existing jQuery scripts.
104+
|
105+
*/
106+
107+
'include_vendors' => env('DEBUGBAR_INCLUDE_VENDORS', true),
108+
109+
/*
110+
|--------------------------------------------------------------------------
111+
| Capture Ajax Requests
112+
|--------------------------------------------------------------------------
113+
|
114+
| The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
115+
| you can use this option to disable sending the data through the headers.
116+
|
117+
| Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools.
118+
|
119+
| Note for your request to be identified as ajax requests they must either send the header
120+
| X-Requested-With with the value XMLHttpRequest (most JS libraries send this), or have application/json as a Accept header.
121+
|
122+
| By default `ajax_handler_auto_show` is set to true allowing ajax requests to be shown automatically in the Debugbar.
123+
| Changing `ajax_handler_auto_show` to false will prevent the Debugbar from reloading.
124+
|
125+
| You can defer loading the dataset, so it will be loaded with ajax after the request is done. (Experimental)
126+
*/
127+
128+
'capture_ajax' => env('DEBUGBAR_CAPTURE_AJAX', true),
129+
'add_ajax_timing' => env('DEBUGBAR_ADD_AJAX_TIMING', false),
130+
'ajax_handler_auto_show' => env('DEBUGBAR_AJAX_HANDLER_AUTO_SHOW', true),
131+
'ajax_handler_enable_tab' => env('DEBUGBAR_AJAX_HANDLER_ENABLE_TAB', true),
132+
'defer_datasets' => env('DEBUGBAR_DEFER_DATASETS', false),
133+
/*
134+
|--------------------------------------------------------------------------
135+
| Custom Error Handler for Deprecated warnings
136+
|--------------------------------------------------------------------------
137+
|
138+
| When enabled, the Debugbar shows deprecated warnings for Symfony components
139+
| in the Messages tab.
140+
|
141+
*/
142+
'error_handler' => env('DEBUGBAR_ERROR_HANDLER', false),
143+
144+
/*
145+
|--------------------------------------------------------------------------
146+
| Clockwork integration
147+
|--------------------------------------------------------------------------
148+
|
149+
| The Debugbar can emulate the Clockwork headers, so you can use the Chrome
150+
| Extension, without the server-side code. It uses Debugbar collectors instead.
151+
|
152+
*/
153+
'clockwork' => env('DEBUGBAR_CLOCKWORK', false),
154+
155+
/*
156+
|--------------------------------------------------------------------------
157+
| DataCollectors
158+
|--------------------------------------------------------------------------
159+
|
160+
| Enable/disable DataCollectors
161+
|
162+
*/
163+
164+
'collectors' => [
165+
'phpinfo' => env('DEBUGBAR_COLLECTORS_PHPINFO', false), // Php version
166+
'messages' => env('DEBUGBAR_COLLECTORS_MESSAGES', true), // Messages
167+
'time' => env('DEBUGBAR_COLLECTORS_TIME', true), // Time Datalogger
168+
'memory' => env('DEBUGBAR_COLLECTORS_MEMORY', true), // Memory usage
169+
'exceptions' => env('DEBUGBAR_COLLECTORS_EXCEPTIONS', true), // Exception displayer
170+
'log' => env('DEBUGBAR_COLLECTORS_LOG', true), // Logs from Monolog (merged in messages if enabled)
171+
'db' => env('DEBUGBAR_COLLECTORS_DB', true), // Show database (PDO) queries and bindings
172+
'views' => env('DEBUGBAR_COLLECTORS_VIEWS', true), // Views with their data
173+
'route' => env('DEBUGBAR_COLLECTORS_ROUTE', false), // Current route information
174+
'auth' => env('DEBUGBAR_COLLECTORS_AUTH', false), // Display Laravel authentication status
175+
'gate' => env('DEBUGBAR_COLLECTORS_GATE', true), // Display Laravel Gate checks
176+
'session' => env('DEBUGBAR_COLLECTORS_SESSION', false), // Display session data
177+
'symfony_request' => env('DEBUGBAR_COLLECTORS_SYMFONY_REQUEST', true), // Only one can be enabled..
178+
'mail' => env('DEBUGBAR_COLLECTORS_MAIL', true), // Catch mail messages
179+
'laravel' => env('DEBUGBAR_COLLECTORS_LARAVEL', true), // Laravel version and environment
180+
'events' => env('DEBUGBAR_COLLECTORS_EVENTS', false), // All events fired
181+
'default_request' => env('DEBUGBAR_COLLECTORS_DEFAULT_REQUEST', false), // Regular or special Symfony request logger
182+
'logs' => env('DEBUGBAR_COLLECTORS_LOGS', false), // Add the latest log messages
183+
'files' => env('DEBUGBAR_COLLECTORS_FILES', false), // Show the included files
184+
'config' => env('DEBUGBAR_COLLECTORS_CONFIG', false), // Display config settings
185+
'cache' => env('DEBUGBAR_COLLECTORS_CACHE', false), // Display cache events
186+
'models' => env('DEBUGBAR_COLLECTORS_MODELS', true), // Display models
187+
'livewire' => env('DEBUGBAR_COLLECTORS_LIVEWIRE', true), // Display Livewire (when available)
188+
'jobs' => env('DEBUGBAR_COLLECTORS_JOBS', false), // Display dispatched jobs
189+
'pennant' => env('DEBUGBAR_COLLECTORS_PENNANT', false), // Display Pennant feature flags
190+
],
191+
192+
/*
193+
|--------------------------------------------------------------------------
194+
| Extra options
195+
|--------------------------------------------------------------------------
196+
|
197+
| Configure some DataCollectors
198+
|
199+
*/
200+
201+
'options' => [
202+
'time' => [
203+
'memory_usage' => env('DEBUGBAR_OPTIONS_TIME_MEMORY_USAGE', false), // Calculated by subtracting memory start and end, it may be inaccurate
204+
],
205+
'messages' => [
206+
'trace' => env('DEBUGBAR_OPTIONS_MESSAGES_TRACE', true), // Trace the origin of the debug message
207+
'capture_dumps' => env('DEBUGBAR_OPTIONS_MESSAGES_CAPTURE_DUMPS', false), // Capture laravel `dump();` as message
208+
],
209+
'memory' => [
210+
'reset_peak' => env('DEBUGBAR_OPTIONS_MEMORY_RESET_PEAK', false), // run memory_reset_peak_usage before collecting
211+
'with_baseline' => env('DEBUGBAR_OPTIONS_MEMORY_WITH_BASELINE', false), // Set boot memory usage as memory peak baseline
212+
'precision' => (int) env('DEBUGBAR_OPTIONS_MEMORY_PRECISION', 0), // Memory rounding precision
213+
],
214+
'auth' => [
215+
'show_name' => env('DEBUGBAR_OPTIONS_AUTH_SHOW_NAME', true), // Also show the users name/email in the debugbar
216+
'show_guards' => env('DEBUGBAR_OPTIONS_AUTH_SHOW_GUARDS', true), // Show the guards that are used
217+
],
218+
'gate' => [
219+
'trace' => false, // Trace the origin of the Gate checks
220+
],
221+
'db' => [
222+
'with_params' => env('DEBUGBAR_OPTIONS_WITH_PARAMS', true), // Render SQL with the parameters substituted
223+
'exclude_paths' => [ // Paths to exclude entirely from the collector
224+
// 'vendor/laravel/framework/src/Illuminate/Session', // Exclude sessions queries
225+
],
226+
'backtrace' => env('DEBUGBAR_OPTIONS_DB_BACKTRACE', true), // Use a backtrace to find the origin of the query in your files.
227+
'backtrace_exclude_paths' => [], // Paths to exclude from backtrace. (in addition to defaults)
228+
'timeline' => env('DEBUGBAR_OPTIONS_DB_TIMELINE', false), // Add the queries to the timeline
229+
'duration_background' => env('DEBUGBAR_OPTIONS_DB_DURATION_BACKGROUND', true), // Show shaded background on each query relative to how long it took to execute.
230+
'explain' => [ // Show EXPLAIN output on queries
231+
'enabled' => env('DEBUGBAR_OPTIONS_DB_EXPLAIN_ENABLED', false),
232+
],
233+
'hints' => env('DEBUGBAR_OPTIONS_DB_HINTS', false), // Show hints for common mistakes
234+
'show_copy' => env('DEBUGBAR_OPTIONS_DB_SHOW_COPY', true), // Show copy button next to the query,
235+
'slow_threshold' => env('DEBUGBAR_OPTIONS_DB_SLOW_THRESHOLD', false), // Only track queries that last longer than this time in ms
236+
'memory_usage' => env('DEBUGBAR_OPTIONS_DB_MEMORY_USAGE', false), // Show queries memory usage
237+
'soft_limit' => (int) env('DEBUGBAR_OPTIONS_DB_SOFT_LIMIT', 100), // After the soft limit, no parameters/backtrace are captured
238+
'hard_limit' => (int) env('DEBUGBAR_OPTIONS_DB_HARD_LIMIT', 500), // After the hard limit, queries are ignored
239+
],
240+
'mail' => [
241+
'timeline' => env('DEBUGBAR_OPTIONS_MAIL_TIMELINE', true), // Add mails to the timeline
242+
'show_body' => env('DEBUGBAR_OPTIONS_MAIL_SHOW_BODY', true),
243+
],
244+
'views' => [
245+
'timeline' => env('DEBUGBAR_OPTIONS_VIEWS_TIMELINE', true), // Add the views to the timeline
246+
'data' => env('DEBUGBAR_OPTIONS_VIEWS_DATA', false), // True for all data, 'keys' for only names, false for no parameters.
247+
'group' => (int) env('DEBUGBAR_OPTIONS_VIEWS_GROUP', 50), // Group duplicate views. Pass value to auto-group, or true/false to force
248+
'inertia_pages' => env('DEBUGBAR_OPTIONS_VIEWS_INERTIA_PAGES', 'js/Pages'), // Path for Inertia views
249+
'exclude_paths' => [ // Add the paths which you don't want to appear in the views
250+
'vendor/filament', // Exclude Filament components by default
251+
],
252+
],
253+
'route' => [
254+
'label' => env('DEBUGBAR_OPTIONS_ROUTE_LABEL', true), // Show complete route on bar
255+
],
256+
'session' => [
257+
'hiddens' => [], // Hides sensitive values using array paths
258+
],
259+
'symfony_request' => [
260+
'label' => env('DEBUGBAR_OPTIONS_SYMFONY_REQUEST_LABEL', true), // Show route on bar
261+
'hiddens' => [], // Hides sensitive values using array paths, example: request_request.password
262+
],
263+
'events' => [
264+
'data' => env('DEBUGBAR_OPTIONS_EVENTS_DATA', false), // Collect events data, listeners
265+
'excluded' => [], // Example: ['eloquent.*', 'composing', Illuminate\Cache\Events\CacheHit::class]
266+
],
267+
'logs' => [
268+
'file' => env('DEBUGBAR_OPTIONS_LOGS_FILE', null),
269+
],
270+
'cache' => [
271+
'values' => env('DEBUGBAR_OPTIONS_CACHE_VALUES', true), // Collect cache values
272+
],
273+
],
274+
275+
/*
276+
|--------------------------------------------------------------------------
277+
| Inject Debugbar in Response
278+
|--------------------------------------------------------------------------
279+
|
280+
| Usually, the debugbar is added just before </body>, by listening to the
281+
| Response after the App is done. If you disable this, you have to add them
282+
| in your template yourself. See http://phpdebugbar.com/docs/rendering.html
283+
|
284+
*/
285+
286+
'inject' => env('DEBUGBAR_INJECT', true),
287+
288+
/*
289+
|--------------------------------------------------------------------------
290+
| Debugbar route prefix
291+
|--------------------------------------------------------------------------
292+
|
293+
| Sometimes you want to set route prefix to be used by Debugbar to load
294+
| its resources from. Usually the need comes from misconfigured web server or
295+
| from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97
296+
|
297+
*/
298+
'route_prefix' => env('DEBUGBAR_ROUTE_PREFIX', '_debugbar'),
299+
300+
/*
301+
|--------------------------------------------------------------------------
302+
| Debugbar route middleware
303+
|--------------------------------------------------------------------------
304+
|
305+
| Additional middleware to run on the Debugbar routes
306+
*/
307+
'route_middleware' => [],
308+
309+
/*
310+
|--------------------------------------------------------------------------
311+
| Debugbar route domain
312+
|--------------------------------------------------------------------------
313+
|
314+
| By default Debugbar route served from the same domain that request served.
315+
| To override default domain, specify it as a non-empty value.
316+
*/
317+
'route_domain' => env('DEBUGBAR_ROUTE_DOMAIN', null),
318+
319+
/*
320+
|--------------------------------------------------------------------------
321+
| Debugbar theme
322+
|--------------------------------------------------------------------------
323+
|
324+
| Switches between light and dark theme. If set to auto it will respect system preferences
325+
| Possible values: auto, light, dark
326+
*/
327+
'theme' => env('DEBUGBAR_THEME', 'auto'),
328+
329+
/*
330+
|--------------------------------------------------------------------------
331+
| Backtrace stack limit
332+
|--------------------------------------------------------------------------
333+
|
334+
| By default, the Debugbar limits the number of frames returned by the 'debug_backtrace()' function.
335+
| If you need larger stacktraces, you can increase this number. Setting it to 0 will result in no limit.
336+
*/
337+
'debug_backtrace_limit' => (int) env('DEBUGBAR_DEBUG_BACKTRACE_LIMIT', 50),
338+
];

storage/debugbar/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)