Appearance
Debugging
Clockwork
Our tool of choice to debug backend is Clockwork. Unlike DebugBar, Clockwork doesn’t modify HTML DOM and works only when devTools are open.
- Update your .env:
CLOCKWORK_ENABLE=true - Install an extension for the browser of your choice: https://github.com/itsgoingd/clockwork?tab=readme-ov-file#browser-extension
- Open your browser devTools, you will see a new tab called Clockwork wit detailed info about the request
dd(), dump() and ray()
Laravel ships with dump() and dd() functions to debug your code. These functions are great for quick debugging, but they are not suitable for long-term debugging. If you want to change the debug output source, you can use ray() function from Spatie. Together with buggregator, it can be a powerful tool for debugging: you still will have dump()-like output but without clattering your application output (HTML or JSON). (you don't need to purchase the Ray app, as Buggregator can display Ray output for free. Bonus: you can install Always on Top Window Firefox or Always on Top Window Chrome to make DX even better).
xdebug
We use Laravel Sail, so you can check Debugging With Xdebug from the official documentation.
Have some Docker-related xdebug questions? Check out the Docker xdebug guide.