buggregator/trap
Buggregator Trap enhances PHP debugging with instant Symfony VarDumper integrations, handy helper functions, and a lightweight local Buggregator server (no Docker). Connect to any Buggregator server and pair with the PhpStorm plugin for a smooth workflow.
dd(), dump(), Symfony VarDumper), offering a unified debugging experience without disrupting core workflows.--dev package, avoiding production bloat.dump()) and extends them with Trap’s features.9912, 9913, 1025, 8000) with Laravel’s default services (e.g., queues, HTTP), reducing port conflicts.symfony/var-dumper, barryvdh/laravel-debugbar). Mitigation: Use --dev isolation and explicit sender configuration (-sconsole).google/protobuf for full feature set. Risk: Laravel apps without protobuf may miss advanced debugging. Mitigation: Graceful fallback to raw dumps.trap()/tr()/td() functions integrate with Laravel’s existing dump()/dd()? Will it require developer training?Sentry package? Will it replace or complement it?Symfony VarDumper and dd(), making it a drop-in replacement for basic debugging.td() (dump-and-die) or tr() (trace) in test assertions.Phase 1: Local Debugging
--dev dependency: composer require --dev buggregator/trap.dd($var) with trap($var) in app/Console/Kernel.php or routes/web.php for local testing.vendor/bin/trap -sconsole.Phase 2: IDE Integration
--ui=8000) for web-based inspection.Phase 3: Advanced Debugging
-sfile) to persist dumps for post-mortem analysis.Phase 4: CI/CD
TRAP_ENABLED=false (if supported) or skip installation in composer.json.--ui for web-based debug views.| Laravel Component | Trap Compatibility | Notes |
|---|---|---|
| Symfony VarDumper | ✅ Full support | Extends existing dump()/dd() |
| Monolog | ✅ Full support | Logs debug dumps as structured events |
| Sentry | ✅ Partial (custom integration needed) | Use -ssentry sender for error tracking |
| Laravel Debugbar | ⚠️ May conflict | Disable Debugbar or use separate ports |
| gRPC/Protobuf | ✅ Enhanced support | Human-readable protobuf dumps |
| Queue Workers | ⚠️ Risk of port conflicts | Use --host=127.0.0.1 to isolate |
| HTTP Tests (PestPHP) | ✅ Supported | Use td() for test assertions |
trap() in app/Providers/AppServiceProvider for global debugging.dd() with td() in test files for immediate failure inspection.-sfile -smail-to-file) for debugging without affecting production.-ssentry for error tracking only.TRAP_RUNTIME_DIR=/tmp/trap for ephemeral storage.-sconsole only in development.dd(). New features (tr(), td()) require minimal training.google/protobuf).-sconsole only.-sserver for remote Buggregator instances.| Failure Scenario | Impact | Mitigation |
|---|---|---|
Port conflicts (9912, 1025) |
Debug dumps lost or misrouted | Use -p to customize ports |
| Protobuf parsing errors | Raw binary dumps in console | Install google/protobuf or ignore |
| File sender storage exhaustion | Disk full or permission errors | Set TRAP_RUNTIME_DIR to /tmp |
| CI/CD interference | Tests fail due to missing server | Skip installation in CI |
| PHP version incompatibility | Trap fails to load | Pin to Laravel’s PHP version (8.2+) |
trap() + vendor/bin/trap).trap() vs. dd().How can I help you explore Laravel packages today?