Since Tinkerwell 2.2, it is possible to interactivly debug your Laravel apps. You can think of it as a
dd helper with super powers. It allows you to instantly open up Tinkerwell and make your variables available in Tinkerwell.
Here's a quick video of how that looks like:
To make use of this in your own Laravel application, you first need to install a little package:
composer require --dev beyondcode/tinkerwell-helper
Once the package is installed, you have access to a global helper method called
A simple example would be:
$user = User::first(); tinker($user);
This will open up Tinkerwell and you will have immediate access to the
But you do not need to have a temporary variable, if you just want to inspect something. You can also do:
This is also going to open up Tinkerwell, but as you seen we have not given the data a specific variable name.
To access this variable in Tinkerwell, you can use the
$temp0 variable name.
You can also pass multiple things to the
tinker($user, "a string", "something else");
This will make three variables available in Tinkerwell, named
The tinker helper method really helped me boost my development workflow. It is also extremely handy when you want to debug some data that happens inside a queued job. Just put the
tinker method in there and inspect the data using Tinkerwell.
Please note, that this feature currently only works on MacOS.