soloterm / dumps
A Laravel command to intercept dumps from your Laravel application.
Fund package maintenance!
aarondfrancis
aaronfrancis.com/backstage
Installs: 1 143
Dependents: 2
Suggesters: 0
Security: 0
Stars: 8
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- illuminate/console: ^10|^11|^12
- illuminate/support: ^10|^11|^12
Requires (Dev)
- illuminate/process: ^10|^11|^12
- orchestra/testbench: ^8.29|^9.5|^10
- phpunit/phpunit: ^10.5|^11
README
Solo Dumps for Laravel is a package that intercepts and collects dump()
calls from your Laravel application and displays
them in a dedicated terminal window. This eliminates the need to clutter your browser or API responses with debug
output.
This library was built to support Solo, your all-in-one Laravel command to tame local development.
This package is especially useful when:
- You're working with APIs where you can't see dumps in the browser
- You want to keep your browser console clean
- You want to centralize all your debugging output in one place
- You need source file information for your dumps
Installation
- Require the package:
composer require soloterm/dumps --dev
The package will automatically register the service provider.
Usage
Simply run:
php artisan solo:dumps
This will start a server that intercepts all dump()
calls from your Laravel application. The command will keep running
and display any dumps in real-time.
Now when you use dump()
anywhere in your application, the output will be sent to this terminal window instead of your
browser or API response.
Features
- Intercepts all
dump()
calls from your Laravel application - Shows the exact file and line number where the dump was called
- Formats the output using Laravel's CLI dumper for better readability
- Works with APIs, background jobs, and other contexts where dumps are normally hard to see
- Preserves all the functionality of Laravel's dump helper
- Restores regular dump functionality when the command is stopped
Works with Solo for Laravel
If you're using Solo for Laravel, you can add the dumps command to your configuration:
// config/solo.php 'commands' => [ // ... other commands 'Dumps' => 'php artisan solo:dumps', ],
Configuration
You can configure the dump server host in your config/solo.php
file:
// config/solo.php return [ // ... other configurations 'dump_server_host' => 'tcp://127.0.0.1:9984', ];
There is no dedicated dumps
config file. You can either create a solo.php
and put the dump_server_host
in there, or add it to your existing solo.php
file.
How It Works
The package works by:
- Registering a custom var dumper handler that captures dump calls
- Resolving the source file and line number of the dump before sending to the server
- Sending the dump data to a server running in a separate process
- Displaying the formatted dump with source information in the terminal
FAQ
Does this work with dd()?
No, this package only intercepts dump()
calls. The dd()
function will still halt execution as normal.
Can I use this with APIs?
Yes! This is one of the main benefits. Your API responses will remain clean while all dumps go to the dedicated terminal window.
Will this affect my application in production?
The package is designed to be used in development only. It's recommended to install it with the --dev
flag to ensure
it's not included in production.
Support
This is free! If you want to support me:
- Sponsor my open source work: aaronfrancis.com/backstage
- Check out my courses:
- Help spread the word about things I make
Credits
Dumps for Laravel was developed by Aaron Francis. If you like it, please let me know!
- Twitter: https://twitter.com/aarondfrancis
- Website: https://aaronfrancis.com
- YouTube: https://youtube.com/@aarondfrancis
- GitHub: https://github.com/aarondfrancis