nodrew/php-airbrake-bundle
Symfony bundle for integrating Airbrake error tracking into PHP applications. It captures exceptions and errors, sends them to Airbrake for monitoring and alerting, and supports straightforward configuration for environment-specific reporting so teams can spot and fix production issues faster.
composer require nodrew/php-airbrake-bundle will drag in symfony/framework-bundle and its version constraints. In a Laravel app you cannot install it as-is; the practical move is to read it as a blueprint and reproduce the two things it does: configure an Airbrake client and hook exception reporting.composer.json — PHP floor (likely 5.3.x), Symfony constraint, and the underlying notifier (nodrew/php-airbrake / dbtlr/php-airbrake). This tells you whether anything is salvageable.DependencyInjection/Configuration.php — the real config surface: api_key, environment, queue, timeout, excluded exceptions.Resources/config/services.yml — the service IDs (typically airbrake.client, airbrake.exception_listener) and how they're constructed.component, action, route) it attaches to a notice.kernel.exception; in Laravel the equivalent single insertion point is App\Exceptions\Handler::report().Minimal Laravel-side steps to get the same behavior:
composer require nodrew/php-airbrake if a compatible version resolves — otherwise use a maintained notifier, since only the client matters here.Airbrake\Client in the container. Mirror that in Laravel:$this->app->singleton(\Airbrake\Client::class, fn () => new \Airbrake\Client(
new \Airbrake\Configuration(config('airbrake.api_key'), [
'environmentName' => app()->environment(),
'component' => 'laravel',
'timeout' => 2,
])
));
public function report(Throwable $e): void
{
if (! config('app.debug') && $this->shouldReport($e)) {
try {
app(\Airbrake\Client::class)->notifyOnException($e);
} catch (Throwable $ignored) {
// never let the notifier mask the original error
}
}
parent::report($e);
}
$dontReport is the Laravel analog of the bundle's excluded-exception list. Keep 404s, ValidationException, and auth failures out of Airbrake — this single list does more for signal quality than any other setting.tap class on the logger that forwards only >= warning, so logged-but-handled errors still reach Airbrake.component, action (route), and request info. In Laravel, attach the route name and authenticated user ID to the notice so errors group sensibly in the dashboard instead of producing one bucket per closure.config/airbrake.php reading APP_ENV, and disable entirely for local and testing so test runs never hit the network.services.yml with the old schema and @service references; they won't autoload as PSR-4. Even if Composer resolves, the bundle's container wiring is inert in Laravel./notifier_api/v2/notices) to v3/v4 endpoints with project keys and different payload shapes. Check what endpoint the bundled client targets and test a manual notify() before trusting the listener — a wrong key or endpoint often fails silently with a 4xx.report(), and never let Airbrake throw into the error path.report() runs before rendering — throwing there replaces the user-facing error with a 500 and destroys the original stack trace.getConfiguration() and the serialized notice to verify what is actually being sent.airbrake.client service or subclass the exception listener. In Laravel, bind an interface and decorate it, or add a reportable() callback for one-off exceptions needing extra params — that's the cleanest seam for customizing payloads.How can I help you explore Laravel packages today?