bernardosecades/laravel-debug-container
bootstrap/app.php (environment-conditional).development env; accidental activation in production could expose sensitive container state (e.g., passwords, API keys).debug:container in large apps (e.g., 500+ bindings)?App\Services\PaymentGateway)?debugbar or telescope exclusions?UserRepository not injected?").staging).debug:container against a known subset of bindings (e.g., Auth, Mail).APP_ENV === 'local' or APP_DEBUG === true (beyond the README’s development check).if (app()->environment(['local', 'staging']) && app()->bound('debugbar')) {
$app->register(\BernardoSecades\Laravel\DebugContainer\DebugContainerServiceProvider::class);
}
config('services.stripe.secret')).Container implementations.bootstrap/app.php structure without register()).ServiceProvider registrations for conflicts.php artisan debug:container and compare output to expectations.bootstrap/app.php conventions).dd(app()) (manual inspection).laravel-debugbar (structured container inspection).tightenco/ziggy (for route/service mapping).grep or custom wrapper script).| Scenario | Impact | Mitigation |
|---|---|---|
| Accidental production use | Exposes container state (e.g., API keys) | Environment guardrails (see above). |
| Laravel version mismatch | Command fails silently | Test on target Laravel version. |
| Circular dependencies | CLI hangs or crashes | Use dd(app()->make('Service')) instead. |
| No output | False sense of security | Verify DebugContainerServiceProvider is registered. |
bootstrap/app.php.php artisan debug:container and interpret output.dd() for targeted debugging.laravel-debugbar: Richer inspection (including container).spatie/laravel-debugbar: More maintainable.dd(app()): For one-off checks.How can I help you explore Laravel packages today?