raulfraile/ladybug
Ladybug is an extensible var_dump/print_r replacement for PHP 5.3+ that renders any variable, object, or resource in a clean, readable format. Simple global helper (ladybug_dump) with solid docs and framework integrations.
dump(), dd()). Ladybug’s customization (e.g., handlers, formatters) may justify adoption if:
use Symfony\Component\VarDumper\Dumper\CliDumper with use Ladybug\Ladybug.AppServiceProvider to swap the dumper globally or per-context.if (app()->environment('local')))?dd($var) in a single controller with Ladybug::dump($var).AppServiceProvider:
use Ladybug\Ladybug;
use Symfony\Component\Debug\Debug;
public function boot()
{
if (!app()->environment('production')) {
Debug::enable();
$this->registerLadybugDumper();
}
}
protected function registerLadybugDumper()
{
// Replace Symfony's dumper with Ladybug
$handler = new Ladybug\Handler\HtmlHandler();
Ladybug::setHandler($handler);
// Or extend for custom formats
}
DebugMiddleware to enable Ladybug for /debug/* routes.php -v).dd() in non-critical areas (e.g., tests, CLI).use Ladybug\Ladybug;
use Illuminate\Foundation\Exceptions\Handler;
public function report(Throwable $e)
{
if (app()->environment('local')) {
Ladybug::dump($e->getTrace());
}
}
if (app()->debugging())).memory_get_usage()).| Risk | Impact | Mitigation |
|---|---|---|
| PHP 8.x incompatibility | Breaks Laravel 9+ apps | Fork/patch Ladybug or avoid adoption |
| Data leaks in production | Security/PII exposure | Environment checks (!production) |
| Stale maintenance | Unpatched vulnerabilities | Monitor for forks/alternatives |
| Poor IDE/tooling support | Developer friction | Configure IDE for Ladybug namespace |
dd()").Ladybug::dump() calls).How can I help you explore Laravel packages today?