spiral/debug
Spiral Debug adds a lightweight debugging toolkit for Spiral/PHP apps. Capture and inspect errors, exceptions, logs, and runtime details during development, with simple integration and minimal overhead for troubleshooting and diagnostics.
composer require spiral/debug --devSpiral\Debug\Bootloader\DebugBootloader::class to app/src/Kernel.php’s bootloaders() method only in dev/staging environments (avoid production).\Spiral\Debug\Collector\DebugCollector::capture() to manually dump structured data during development.DebugCollector::capture($context, 'tag') to log arbitrary data (e.g., variables, DB queries) for inspection via the web UI or CLI dump.DebugMiddleware (from Spiral\Debug\Middleware) to automatically log incoming requests, responses, and timing for specific routes or route groups. Register it in route definitions:
$router->addRoute('/api/*', [Controller::class, 'handle'], [
'middleware' => [DebugMiddleware::class],
]);
Spiral\Debug\Exception\DebugException or DebugExceptionInterface to tag exceptions with extra context (e.g., user session, DB state) for richer error pages.php app.php debug:collect (if CLI command exists) or use DebugCollector::flush() in tests/scripts to export captured data to files for later inspection.if ($app->environment() === 'development').Spiral\ExceptionHandler), ensure DebugBootloader loads after your handler or override its configurations to avoid conflicts.capture() calls without output context (e.g., in CLI without -v) may silently store data—always verify output location or set debug.output = 'stream://stdout' in config.app/config/debug.php to tweak:
output (e.g., 'file://storage/debug.log' for file logging),max_depth for nested data,collectors to enable/disable DB/Request/Session collectors.How can I help you explore Laravel packages today?