- How do I install Bugsnag in a Laravel application?
- For Laravel, install bugsnag/bugsnag-laravel rather than the core bugsnag/bugsnag package directly. The Laravel wrapper pulls in the core notifier transitively and integrates with Laravel's exception handling and context capture. Configure it through the published config and environment variables, using a separate API key per environment. If you install only the core package by hand, you risk fighting Laravel's own exception handler and losing framework context.
- What is bugsnag/bugsnag used for?
- It is the framework-agnostic PHP notifier for Bugsnag, now SmartBear, error monitoring. It automatically reports unhandled exceptions and fatal errors, and lets you manually report handled exceptions. You can attach user information and custom diagnostic metadata to see who is affected and add context. It is the client SDK for a commercial SaaS backend, so it does not provide value without a Bugsnag account.
- Do I need bugsnag/bugsnag-laravel when using Laravel?
- Yes, in a Laravel codebase the real dependency should be bugsnag/bugsnag-laravel. It pulls bugsnag/bugsnag in transitively and provides the framework-specific wrapper. Installing the core package directly means fighting Laravel's exception handler and likely losing framework context capture. Keep the wrapper as your maintained version pin and let Composer resolve the core notifier.
- Which PHP and Laravel versions does bugsnag/bugsnag support?
- The core package has broad historic PHP support, and recent changelog entries show PHP 8.4 fixes, Guzzle 8 support, and removal of deprecated functions such as utf8_encode and strftime. Laravel version compatibility is determined by the bugsnag/bugsnag-laravel wrapper, so check that package's Composer constraints for your Laravel release. Also review the core changelog because minor releases can change semantics, not just fix bugs.
- How do I manually report handled exceptions with Bugsnag PHP?
- Use the notifier's client API to report handled exceptions from your catch blocks and to leave breadcrumbs where useful. In Laravel, use the wrapper's integration so reports include framework context and your configured metadata. For standalone PHP services, instantiate the client and call the appropriate notify method after registering the handler early in bootstrap. The package is designed for both automatic unhandled reporting and manual handled reporting.
- What are alternatives to Bugsnag for Laravel, and can they conflict?
- Bugsnag competes with services such as Sentry and APM tools, but this package is only the Bugsnag client for a commercial backend. You can run two agents in non-production to compare, but the core package installs global error, exception, and shutdown handlers. Conflicts with Sentry, Whoops, APM tools, or framework handlers are the classic failure mode. Test against the full handler stack and avoid mixing standalone and wrapper patterns in one codebase.
- How do I prevent sensitive data from being sent to Bugsnag?
- Configure redaction before production because error payloads can include full request, user, and session context. Defaults improved materially: cookies and HTTP basic auth have been filtered since 3.23.0, and regex-capable redacted keys arrived in 3.26.0. The older filters option is deprecated in favor of redactedKeys. Defaults are not a policy, so define a redaction list and data classification that match your GDPR, PCI, or HIPAA obligations.
- Can I use bugsnag/bugsnag outside Laravel?
- Yes. This package is the framework-agnostic notifier for plain PHP services, queue workers, legacy apps, and custom integrations. Register the global handler early in bootstrap and use console-aware request extraction for workers. Do not mix the standalone handler pattern and the Laravel wrapper pattern in one codebase. It also has official integrations for Lumen, Symfony, Silex, Magento, WordPress, and other PHP apps.
- Is bugsnag/bugsnag free or does it require a paid account?
- The client library is MIT licensed, but that only covers the notifier code. Bugsnag itself is a commercial SaaS backend from SmartBear, so you need a paid account and should review pricing, roadmap, and procurement risk. The license grants no rights to the backend service. Recent releases also derive endpoints from the API key with a bugsnag.smartbear.com secondary, reinforcing vendor concentration. Treat it as a vendor SDK dependency, not a standalone OSS building block.
- What should I check before upgrading bugsnag/bugsnag?
- Read the changelog for every minor bump because semantics can change. For example, 3.24.0 required errorReportingLevel to be a subset of error_reporting, which is behavioral rather than a bugfix. Check deprecated config such as filters in favor of redactedKeys, and verify handler behavior in staging. Test the full handler stack, redaction rules, and data egress before production rollout.