Skip to content

Commit d7d0309

Browse files
committed
Update features
1 parent d00cf44 commit d7d0309

File tree

5 files changed

+134
-2
lines changed

5 files changed

+134
-2
lines changed

docs/features.md

Lines changed: 131 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,134 @@ And the default collectors:
3131
- MemoryCollector
3232
- ExceptionsCollector
3333

34-
It also provides a facade interface (Debugbar) for easy logging Messages, Exceptions and Time
34+
It also provides a facade interface (Debugbar) for easy logging Messages, Exceptions and Time.
35+
36+
To enable or disable any of the collectors, set the configuration to `true` or `false`. Some collector have additional options in the configuration.
37+
38+
39+
## AJAX Requests
40+
41+
Laravel Debugbar tracks AJAX/XHR request in your application. You can open these in the dropdown menu, or click the history button to show the requests.
42+
43+
Tip: you can disable he 'autoshow' toggle in the history tab to keep the current dataset active, instead of switching.
44+
45+
![AJAX Request](img/ajax.png)
46+
47+
Configuration:
48+
```php
49+
/*
50+
|--------------------------------------------------------------------------
51+
| Capture Ajax Requests
52+
|--------------------------------------------------------------------------
53+
|
54+
| The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
55+
| you can use this option to disable sending the data through the headers.
56+
|
57+
| Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools.
58+
|
59+
| Note for your request to be identified as ajax requests they must either send the header
60+
| X-Requested-With with the value XMLHttpRequest (most JS libraries send this), or have application/json as a Accept header.
61+
|
62+
| By default `ajax_handler_auto_show` is set to true allowing ajax requests to be shown automatically in the Debugbar.
63+
| Changing `ajax_handler_auto_show` to false will prevent the Debugbar from reloading.
64+
*/
65+
66+
'capture_ajax' => true,
67+
'add_ajax_timing' => false,
68+
'ajax_handler_auto_show' => true,
69+
'ajax_handler_enable_tab' => true,
70+
71+
```
72+
73+
## History browser
74+
75+
By default, Debugbar stores request history. This is useful for non-browser requests, redirects or external requests. You can open it with the 'folder' button (3rd from the right).
76+
77+
With the default settings, storage is only visible from your local IP. To enable browsing the history, change the `storage.open` setting or `DEBUGBAR_OPEN_STORAGE` env key.
78+
79+
!!! warning
80+
81+
Do not open the history outside your local environment, to avoid leaking credentials or sensitive data.
82+
83+
![History](img/history.png)
84+
85+
Configuration:
86+
```php
87+
/*
88+
|--------------------------------------------------------------------------
89+
| Storage settings
90+
|--------------------------------------------------------------------------
91+
|
92+
| DebugBar stores data for session/ajax requests.
93+
| You can disable this, so the debugbar stores data in headers/session,
94+
| but this can cause problems with large data collectors.
95+
| By default, file storage (in the storage folder) is used. Redis and PDO
96+
| can also be used. For PDO, run the package migrations first.
97+
|
98+
| Warning: Enabling storage.open will allow everyone to access previous
99+
| request, do not enable open storage in publicly available environments!
100+
| Specify a callback if you want to limit based on IP or authentication.
101+
| Leaving it to null will allow localhost only.
102+
*/
103+
'storage' => [
104+
'enabled' => true,
105+
'open' => env('DEBUGBAR_OPEN_STORAGE'), // bool/callback.
106+
'driver' => 'file', // redis, file, pdo, socket, custom
107+
'path' => storage_path('debugbar'), // For file driver
108+
'connection' => null, // Leave null for default connection (Redis/PDO)
109+
'provider' => '', // Instance of StorageInterface for custom driver
110+
'hostname' => '127.0.0.1', // Hostname to use with the "socket" driver
111+
'port' => 2304, // Port to use with the "socket" driver
112+
],
113+
```
114+
115+
## Editor integration
116+
117+
Debugbar can open links to views, exception, routes etc in your Editor directly, if you set this up correctly. By default this should just work for PHPStorm on local development. You can change your editor by setting `DEBUGBAR_EDITOR` or the config.
118+
If your working in a remote host or docker, you can change the mapping between remote and local paths.
119+
120+
Configuration:
121+
```php
122+
/*
123+
|--------------------------------------------------------------------------
124+
| Editor
125+
|--------------------------------------------------------------------------
126+
|
127+
| Choose your preferred editor to use when clicking file name.
128+
|
129+
| Supported: "phpstorm", "vscode", "vscode-insiders", "vscode-remote",
130+
| "vscode-insiders-remote", "vscodium", "textmate", "emacs",
131+
| "sublime", "atom", "nova", "macvim", "idea", "netbeans",
132+
| "xdebug", "espresso"
133+
|
134+
*/
135+
136+
'editor' => env('DEBUGBAR_EDITOR') ?: env('IGNITION_EDITOR', 'phpstorm'),
137+
138+
/*
139+
|--------------------------------------------------------------------------
140+
| Remote Path Mapping
141+
|--------------------------------------------------------------------------
142+
|
143+
| If you are using a remote dev server, like Laravel Homestead, Docker, or
144+
| even a remote VPS, it will be necessary to specify your path mapping.
145+
|
146+
| Leaving one, or both of these, empty or null will not trigger the remote
147+
| URL changes and Debugbar will treat your editor links as local files.
148+
|
149+
| "remote_sites_path" is an absolute base path for your sites or projects
150+
| in Homestead, Vagrant, Docker, or another remote development server.
151+
|
152+
| Example value: "/home/vagrant/Code"
153+
|
154+
| "local_sites_path" is an absolute base path for your sites or projects
155+
| on your local computer where your IDE or code editor is running on.
156+
|
157+
| Example values: "/Users/<name>/Code", "C:\Users\<name>\Documents\Code"
158+
|
159+
*/
160+
161+
'remote_sites_path' => env('DEBUGBAR_REMOTE_SITES_PATH'),
162+
'local_sites_path' => env('DEBUGBAR_LOCAL_SITES_PATH', env('IGNITION_LOCAL_SITES_PATH')),
163+
164+
```

docs/img/ajax.png

59 KB
Loading

docs/img/history.png

121 KB
Loading
File renamed without changes.

overrides/home.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h1>{{ config.site_description }}</h1>
4343
</p>
4444

4545
<div class="mdx-hero__image">
46-
<img src="assets/preview.png" alt="" width="1133" height="287" draggable="false">
46+
<img src="img/preview.png" alt="" width="1133" height="287" draggable="false">
4747
</div>
4848
<div class="mdx-hero__content">
4949

@@ -54,6 +54,8 @@ <h1>{{ config.site_description }}</h1>
5454
<a href="{{ config.repo_url }}" title="View on Github" class="md-button">
5555
View on Github
5656
</a>
57+
58+
5759
</div>
5860
</div>
5961
</div>

0 commit comments

Comments
 (0)