Detail Dive is a brand new feature of Tinkerwell 4 that provides structured output for your dump
, var_dump
and echo
statements. It also allows you to switch between multiple views of the output based on the type of data you are working with.
You may switch between the traditional "CLI" output (like php artisan tinker
) and the new Detail Dive output by clicking the "Detail Dive" button in the top right corner of the Tinkerwell window.
When Detail Dive is enabled, you may use the dump
, var_dump
and echo
statements as usual.
Instead of the traditional, rather unstructured output, Detail Dive will provide individual cards for each output/dumped value.
If the output is a nested array or object, the output will be collapsed by default. You may click on the arrow icons on each collapsed line to expand the output. Additionally, you may configure Detail Dive to automatically expand all output by default in the Tinkerwell settings.
If you are using dd
or dump
in your project code and trigger a method or function that runs that code, Tinkerwell will show a card for these as well.
You can also set a preferred editor in the settings and open the file from the card directly by clicking on the file path.
Currently, VSCode, PhpStorm and Sublime Text are supported for Windows; macOS also supports TextMate and Nova. Please note that for Sublime Text, the sublime_url helper has to be installed on macOS and subl-protocol on Windows. For PhpStorm on Windows, please install the PhpStorm protocol handler.
When in Detail Dive mode, you may toggle the "SQL" button in the top right corner of the Tinkerwell window to inspect SQL queries that were executed during your code execution.
Please note that this feature is currently only available for Laravel and WordPress projects, and it does not work with MS SQL Server.
When the output of your code is a collection or a nested array, a "table" icon will appear in the top right corner of the output card.
Clicking this icon will open a modal window with a table view of the output.
You can also save the given data as CSV - this is especially useful when building more complex Eloquent queries that you want to access as CSV data. Since Tinkerwell executes the code within your application context (locally or via SSH) you can make use of all your Eloquent model relations or scopes.
When working with the table view, it can be very useful to be able to copy a specific row as either JSON data or even as a PHP array. You may right-click on any row in the table view, which will open up a context menu.
This context menu allows you to choose how you want to copy the given row.
Here's the example output of copying one row as a PHP array:
$array = [ 'name' => 'Marcel', 'role' => 'Creative Genius',];
When the output of your code is a nested array or object, an "eye" icon will appear in the top right corner of the output card.
Clicking this icon will open a modal window with a graph view of the output. This graph view allows you to inspect the structure of the output in a more visual way. You may click on the nodes to expand them and see their children.
When dumping a Laravel view or mailable, you may click the "eye" icon in the top right corner of the output card to open a modal window with a rendered HTML view of the output.
This allows you to quickly inspect the rendered HTML of your views and mailables.
While the HTML preview is open, you may re-run your code via the configured shortcut (default: Cmd/Ctrl + R
) to see the updated HTML output.