Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Web Profiler Bundle

Web Profiler Bundle Laravel Package

symfony/web-profiler-bundle

Provides the Symfony Web Profiler and debug toolbar for development. Inspect requests, routing, templates, database queries, logs, events, and performance metrics via an in-browser UI to speed up debugging and optimization.

View on GitHub
Deep Wiki
Context7

Provides a development tool that gives detailed information about the execution of any request

Frequently asked questions about Web Profiler Bundle
Can I use Symfony’s WebProfilerBundle directly in a vanilla Laravel app without Symfony components?
No, the bundle requires Symfony’s HttpKernel or middleware stack. For vanilla Laravel, you’d need custom middleware to bridge Laravel’s debug data (e.g., queries, events) into Symfony’s Profiler format, which adds significant development effort. Alternatives like Laravel Debugbar or Tideways may be easier.
What Laravel versions officially support Symfony’s WebProfilerBundle?
The bundle itself doesn’t natively support Laravel—it’s designed for Symfony (5.4+). Integration requires Laravel 8+ (for Symfony Bridge compatibility) or manual middleware setup. Test thoroughly with your Laravel version, as middleware conflicts can arise.
How do I disable the Profiler in production to avoid performance overhead?
Use Laravel’s `APP_DEBUG=false` or Symfony’s `PROFILER_ENABLED=false` environment variable. The bundle is zero-overhead in production by default, but ensure no middleware or collectors are accidentally enabled via config. Add CI checks to verify Profiler is disabled.
Will the Profiler toolbar work with Laravel’s Blade templating instead of Twig?
No, the toolbar relies on Twig templates. Workarounds include embedding the Profiler UI in an iframe (if running Symfony alongside Laravel) or using a Blade-Symfony bridge, but this complicates deployment. For Blade-only apps, consider Laravel Debugbar.
Can I profile Laravel-specific features like queue jobs or Eloquent events with this bundle?
Only with custom collectors. You’d need to write adapters to convert Laravel’s debug data (e.g., job execution times) into Symfony’s Profiler format. This requires deep integration with Laravel’s service container and event system, adding complexity.
Is there a way to use the Profiler’s CLI tool (e.g., `php vendor/bin/profiler`) with Laravel?
Yes, but it’s limited. The CLI tool profiles Symfony applications. For Laravel, you’d need to dump debug data (e.g., queries, logs) to a format the Profiler CLI can read, which may not cover all use cases. Alternatives like Blackfire or custom scripts might be more straightforward.
How do I secure the Profiler toolbar in development to prevent unauthorized access?
Symfony’s Profiler uses signed tokens for toolbar visibility. In Laravel, replicate this by checking `APP_DEBUG` and binding the token to the user’s session or IP. Ensure tokens are CSRF-protected and never exposed in production logs or error pages.
What’s the best alternative to Symfony’s Profiler for Laravel if I don’t want to use Symfony components?
Consider **Laravel Debugbar** (lightweight, Blade-compatible) or **Tideways/XHProf** for deep profiling. For enterprise needs, **Blackfire** offers advanced PHP profiling with Laravel plugins. Evaluate based on your need for real-time UI (Debugbar) vs. CLI/exported data (Tideways/Blackfire).
How do I integrate the Profiler with Laravel’s middleware stack without conflicts?
Register `ProfilerMiddleware` as early as possible in Laravel’s middleware stack (e.g., before `VerifyCsrfToken`). Use priority constants to avoid clashes with Laravel’s middleware. Test with `php artisan route:list` to ensure Profiler routes don’t interfere with existing routes.
Can I profile API requests or headless Laravel/Lumen apps with this bundle?
For Lumen or headless apps, the Profiler UI won’t render without a frontend. Workarounds include exposing Profiler data via JSON endpoints (custom collectors) or using the CLI tool with exported data. For Lumen, consider **Laravel Debugbar** or **Spatie’s Laravel Debugbar** instead.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
headercat/phpstan-extension-ide-helper
yosymfony/parser-utils
innmind/black-box
babenkoivan/elastic-migrations
babenkoivan/elastic-adapter
sandermuller/package-boost-php
sandermuller/boost-core
depa/sulu-google-reviews-bundle
croct/plug-symfony
develia/commons
dmstr/symfony-system-resources-bundle
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
renatomarinho/laravel-page-speed
develia/geo-bundle
austinheap/laravel-database-encryption
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
imbo/imbo-coding-standard