Debugging in Laravel doesn’t have to be messy. For years, developers relied on dd() or dump() to debug variables, but these methods interrupt the application flow and clutter the frontend. Tools like Telescope and Debugbar improved debugging, but now, a new package — LaraDumps — takes it to the next level.
In this article, we’ll explore how LaraDumps enhances Laravel debugging, along with real-world examples of its powerful features.
🔍 What is LaraDumps?
LaraDumps is an open-source package that allows you to debug Laravel applications more efficiently. Instead of dumping data directly in your browser, LaraDumps provides a dedicated desktop app where all your debug outputs are displayed neatly.
This means:
- No more breaking your UI with
dd()calls. - Clean, formatted debug outputs.
- Real-time monitoring of events, queries, and logs.
- Works seamlessly across Laravel projects.
Installation
With LaraDumps, you can start debugging in just a few steps with minimal setup:
- Download the LaraDumps Desktop App
- Install the LaraDumps PHP Package
Requirements: PHP 8.1+ and Laravel 10+
Install LaraDumps Package in your Laravel project using Composer.
Run the command:
composer require laradumps/laradumps ^4.0 --dev -W
Now, configure LaraDumps. Run the command below:
php artisan ds:init $(pwd)
When you run the LaraDumps install command, it will generate a laradumps.yaml file in the root of your project. This file contains all the configuration options for customizing how LaraDumps works.
📌 Key LaraDumps Features with Examples
1. Routes
List all routes in a table format:
ds()->routes();
You can configure LaraDumps to exclude specific routes in the config file.
2. Eloquent Models
Inspect model attributes and relationships:
use App\Models\User;
$latestPost = Post::latest();
ds()->model($latestPost);
3. Stringable Macro
Debug directly inside Laravel’s Stringable pipeline:
use Illuminate\Support\Str;
Str::of('Hello')
->append(' World')
->ds();
4. Collection Macro
Displays the current state of a Collection Macro
collect(['hello', 'world'])
->ds('original input')
->map(fn($string) => ucfirst($string))
->ds('capitalize result');
5. Query Macro
Inspect queries before execution:
use App\Models\User;
User::query()->where('name', 'John')
->ds()
->get();
The macro feature doesn’t require SQL Queries to be enabled in the configuration file.
6. Blade Directive
Debug directly inside Blade templates:
@ds('Hello World')
7. Queries Monitoring
Track SQL queries with queriesOn() and queriesOff():
ds()->queriesOn('checking a user query');
Post::query()->where('id', 1)->get();
ds()->queriesOff();
8. Ignoring Queries
At times, you may want to exclude specific queries from your debug output — especially when you’re focusing on one particular query but your application is executing many others.
To set this up, first publish the LaraDumps configuration file with the following command:
php artisan vendor:publish --tag=laradumps-config
This will create a config/laradumps.php file where you can define the queries (or route patterns) that should be ignored.
9. Table Dumps
Display data in searchable tables:
use App\Models\Post;
$allUsers = Post::all(['id', 'name', 'category']);
ds()->table($allUsers, 'my posts table');
10. Markdown
Render Markdown as HTML in the desktop app:
ds()->markdown('# hello world!');
11. Logs
Receive Laravel logs inside LaraDumps:
use Illuminate\Support\Facades\Log;
Log::info('Your message', ['context' => 'value']);
Log::error('Something went wrong!');
set
observers.logs:truein laradumps.yaml
12. Mailable Preview
Displays mail details and the HTML preview for an instance of a Illuminate\Mail\Mailable class.
ds()->mailable(new \App\Mail\TestMail());
13. HTTP Requests
Capture HTTP client requests:
use Illuminate\Support\Facades\Http;
ds()->httpOn();
Http::get('https://test.com/posts/1');
ds()->httpOff();
14. Artisan Commands
Debug executed Artisan commands:
use Illuminate\Support\Facades\Artisan;
ds()->commandsOn('running a command');
Artisan::call('inspire');
ds()->commandsOff();
15. Scheduled Commands
Monitor scheduled tasks by enabling scheduled_commands in laradumps.yaml:
observers:
scheduled_commands: true
16. Gates
Track gate checks by enabling the gate observer:
observers:
gate: true
17. Jobs
Inspect job execution flow:
observers:
jobs: true
18. Cache
Monitor cache set, get, forget, and missed operations:
ds()->cacheOn('My cache');
cache()->set('feature', 'Cache Observer');
cache()->get('feature');
cache()->forget('feature');
ds()->cacheOff();
🎯 Why LaraDumps?
Unlike traditional tools (dd(), Debugbar, or Telescope), LaraDumps offers:
- ✅ Non-intrusive debugging (doesn’t break your UI)
- ✅ Real-time monitoring of queries, jobs, cache, gates, and more
- ✅ Rich features like table dumps, markdown rendering, and mail previews
- ✅ Customizable observers through
laradumps.yaml
📝 Final Thoughts
If you want to level up your Laravel debugging game, LaraDumps is the tool to try. From simple variable dumps to advanced monitoring of jobs, cache, gates, and HTTP requests, it makes debugging cleaner, faster, and more powerful.
If you found this helpful, feel free to share or drop a comment. Happy coding with Laravel! 🧱✨
Free resources for this topic
Code snippets and fixes for this topic
Get one practical tip every week
New tutorials, fixes and free cheat sheets from DEV Talk, straight to your inbox. No spam, unsubscribe in one click.
Free download: Laravel interview questions (PDF)
Have a question about this post?
Ask the community: other developers and the author can answer.
Get notified about new articles
One click, no email needed. Turn it off anytime with the bell at the top.
Get new articles on your iPhone
Add DEV Talk to your Home Screen, open it, then tap the bell.
Enjoying the content?
If this article helped you, you can support the author with a coffee. It keeps new posts coming.
Comments 0
No comments yet
Be the first to share your thoughts.