Bugsnag Laravel
Report Laravel and Lumen exceptions and crashes to Bugsnag with rich diagnostic context.
Repository Health
Technical Analysis
Bugsnag Laravel is the official Bugsnag notifier for the Laravel and Lumen PHP frameworks. It gives you instant notification of unhandled exceptions and crashes in production, while also letting you report handled exceptions manually with Bugsnag::notify().
The package integrates through a service provider and Laravel’s logging channels, automatically capturing stack traces, request metadata, and user information. It attaches custom diagnostic data so you can understand how many users are affected by a given error and prioritize fixes accordingly.
What You Get
- Automatic reporting of unhandled exceptions and fatal crashes
- A
Bugsnagfacade withnotify()for reporting handled exceptions - Integration as a Laravel logging channel and monolog handler
- User identification and custom diagnostic metadata attachment
- Support for queues, Laravel Octane, and out-of-memory bootstrapping
Common Use Cases
- Monitoring production Laravel apps for uncaught exceptions in real time
- Reporting caught exceptions with extra context from within business logic
- Tracking which users and requests are affected by a recurring error
Under The Hood
Architecture - A BugsnagServiceProvider binds the underlying bugsnag/bugsnag PHP client into the container and registers a Bugsnag facade. It plugs into Laravel’s exception handler and Monolog stack via LaravelLogger/MultiLogger, with middleware (under src/Middleware) enriching each report with request and session context, and dedicated hooks for queues (src/Queue) and Octane (OctaneEventSubscriber).
Tech Stack - Written in PHP (with Blade views for config publishing) and built on the framework-agnostic bugsnag/bugsnag notifier, illuminate/support, and illuminate/contracts. It supports both Laravel and Lumen and covers Laravel Octane and out-of-memory scenarios via an OomBootstrapper.
Code Quality - The repo maintains a substantial PHPUnit suite plus Gherkin/Cucumber end-to-end feature tests and Dockerized maze-runner scenarios, reflecting a mature, well-tested vendor-maintained integration with StyleCI enforcement.
API Design - The public surface is deliberately small: install the provider, set an API key, and either rely on automatic capture or call Bugsnag::notify(). Configuration is publishable and documented, keeping onboarding to a few minutes.