Skip to content
| Marketplace
Sign in
Visual Studio Code>Debuggers>Laravel Debug BuddyNew to Visual Studio Code? Get it now.
Laravel Debug Buddy

Laravel Debug Buddy

Keyur Sanghani

|
241 installs
| (1) | Free
A powerful helper for debugging Laravel code with instant logging, dumping, and execution timing.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Laravel Debug Buddy

Laravel Debug Buddy is a powerful VS Code extension designed to simplify debugging in Laravel applications. It provides quick and easy access to common debugging tasks, such as logging variables, dumping variables, timing code execution, and cleaning up debug statements. With intuitive commands and keyboard shortcuts, this extension enhances productivity and streamlines the debugging process.


Table of Contents

  1. Installation
  2. Features
    • Log Variable
    • DD Variable
    • Time Execution
    • Remove Debug Statements
    • Quick Log Selected Code
    • Quick DD Selected Code
  3. Keyboard Shortcuts
  4. Contributing
  5. Support

Installation

  1. Install from VS Code Marketplace:

    • Open VS Code.
    • Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or pressing Ctrl+Shift+X.
    • Search for "Laravel Debug Buddy".
    • Click Install.
    • Alternatively, you can install it directly from the Marketplace link.
  2. Reload VS Code:

    • After installation, reload VS Code to activate the extension.

Features

Log Variable

Logs the selected variable or text to the Laravel log file using Log::info(). Supports single variables, multiple variables, or plain text.

Examples:

Single Variable:

$user = User::find(1);
\Log::info($user); // Added by DebugBuddy

Plain Text:

"Hello, World!";
\Log::info("Hello, World!"); // Added by DebugBuddy

Multiple Variables:

$user = User::find(1);
$posts = Post::all();
\Log::info(["user" => $user, "posts" => $posts]); // Added by DebugBuddy

String with Variables:

"User email: {$user->email}";
\Log::info("User email: {$user->email}"); // Added by DebugBuddy

DD Variable

Dumps the selected variable(s) or text using Laravel's dd() helper. Supports single variables, multiple variables, or plain text.

Examples:

Single Variable:

$user = User::find(1);
dd($user);

Plain Text:

"Hello, World!";
dd("Hello, World!");

Multiple Variables:

$user = User::find(1);
$posts = Post::all();
dd(["user" => $user, "posts" => $posts]);

String with Variables:

"User email: {$user->email}";
dd("User email: {$user->email}");

Quick Log Selected Code

Quickly logs the selected code or expression below the current line without modifying the original code. This is perfect for logging complex expressions or code blocks.

Examples:

Before (with selected code):

$countryId = Country::where('iso_code', 'US')->first()->id;

After:

$countryId = Country::where('iso_code', 'US')->first()->id;
\Log::info(Country::where('iso_code', 'US')->first()->id); // Added by DebugBuddy

Quick DD Selected Code

Quickly dumps and dies with the selected code or expression below the current line without modifying the original code. This is perfect for inspecting complex expressions or code blocks.

Examples:

Before (with selected code):

$countryId = Country::where('iso_code', 'US')->first()->id;

After:

$countryId = Country::where('iso_code', 'US')->first()->id;
dd(Country::where('iso_code', 'US')->first()->id); // Added by DebugBuddy

Time Execution

Measures the execution time of a selected code block and logs it using Log::info().

Examples:

Single Operation:

$debugBuddyStartTime = microtime(true); // Added by DebugBuddy
$user = User::find(1);
\Log::info("Execution time: " . round((microtime(true) - $debugBuddyStartTime) * 1000, 2) . "ms"); // Added by DebugBuddy

Loop:

$debugBuddyStartTime = microtime(true); // Added by DebugBuddy
foreach ($users as $user) {
    $user->notify(new WelcomeNotification);
}
\Log::info("Execution time: " . round((microtime(true) - $debugBuddyStartTime) * 1000, 2) . "ms"); // Added by DebugBuddy

Remove Debug Statements

Removes all debug statements (Log::info, dd, $debugBuddyStartTime, and execution time logs) from the current file.

Examples:

Before:

\Log::info($user); // Added by DebugBuddy

After:

// Removed

Before:

dd($user);

After:

// Removed

Before:

$debugBuddyStartTime = microtime(true); // Added by DebugBuddy
$user = User::find(1);
\Log::info("Execution time: " . round((microtime(true) - $debugBuddyStartTime) * 1000, 2) . "ms"); // Added by DebugBuddy

After:

$user = User::find(1);

Keyboard Shortcuts

Command Windows/Linux Mac
Log Variable Ctrl+Shift+L Cmd+Shift+L
DD Variable Ctrl+Shift+D Cmd+Shift+D
Time Execution Ctrl+Shift+T Cmd+Shift+T
Remove Debug Statements Ctrl+Shift+R Cmd+Shift+R
Quick Log Selected Code Ctrl+Shift+Q Cmd+Shift+Q
Quick DD Selected Code Ctrl+Shift+W Cmd+Shift+W

Contributing

We welcome contributions to improve Laravel Debug Buddy! Here's how you can contribute:

  1. Fork the Repository:
    Fork the repository on GitHub.

  2. Create a Branch:
    Create a new branch for your feature or bug fix.

  3. Make Changes:
    Implement your changes and ensure the code follows best practices.

  4. Submit a Pull Request:
    Open a pull request with a detailed description of your changes.


Support

If you encounter any issues or have suggestions for improvement, please open an issue on the GitHub Issues page.

For general questions or feedback, feel free to reach out via the repository's GitHub Discussions.


License

Laravel Debug Buddy is open-source software licensed under the MIT License.

Developed with ❤️ by Keyur Sanghani

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft