Server SDK

Error monitoring for Laravel

A Laravel-native package that auto-registers a service provider, binds into the exception handler, and listens for failed queue jobs — no manual wiring beyond the config.

Frameworks Laravel 10 · 11 · 12Requires PHP 8.1+Package errorgap/laravelSource ↗Package ↗Agent guide ↗
Install

Install

sh
composer require errorgap/laravel

The service provider auto-registers. Supports Laravel 10, 11, and 12.

Configure

Configure

Publish the config, then set your credentials in .env:

sh
php artisan vendor:publish --tag=errorgap-config
sh
ERRORGAP_ENDPOINT=https://your-endpoint
ERRORGAP_PROJECT_SLUG=your-project
ERRORGAP_API_KEY=flk_...

The package binds into the Laravel exception handler (preferring reportable() on Laravel 8+) and reports JobFailed queue events. Mirror the keys in .env.example with empty values.

Keep the key in an environment variable (or your framework's secret store) — never commit it to source control.
Trigger a test error

Trigger a test error

php
Route::get('/errorgap-test', function () {
    throw new \Exception('Errorgap test error');
});

Visit /errorgap-test, then remove the route.

Verify

Verify the connection

Confirm your key and endpoint reach errorgap before wiring anything else — send one event straight to the ingestion API:

bash
curl -sS -X POST "$ERRORGAP_ENDPOINT/api/projects/$ERRORGAP_PROJECT_SLUG/notices" \
  -H "content-type: application/json" \
  -H "x-errorgap-project-key: $ERRORGAP_API_KEY" \
  -d '{"errors":[{"type":"ErrorgapInstallTest","message":"Errorgap install verification"}]}'

A 201 with a group_id means ingestion works (202 = received but sampled; 401 = wrong key). Then trigger the test error above through the SDK. Your onboarding screen's Verify step checks the stack off automatically once the first event lands — it polls every three seconds.

Next: the full ingestion API, or browse every SDK.