Laravel SDK
Install errtap/laravel, configure its real environment variables, report exceptions, and send structured logs from Laravel.
Install and configure
composer require errtap/laravelThe auto-discovered service provider reads these values directly; there is no config-publish command:
ERRTAP_DSN=https://et_<key>@your-host
ERRTAP_ENV=production
ERRTAP_RELEASE=1.4.3ERRTAP_ENDPOINT is optional for URL DSNs and required for a bare et_… key.
Database monitoring is enabled by default; tune it with
ERRTAP_SLOW_QUERY_MS, ERRTAP_N1_THRESHOLD, or disable it with
ERRTAP_DB_MONITOR=false.
Exception reporting
Laravel 11+ (bootstrap/app.php):
use Illuminate\Foundation\Configuration\Exceptions;
->withExceptions(function (Exceptions $exceptions) {
$exceptions->reportable(
fn (Throwable $e) => \ErrTap\ErrTap::captureException($e)
);
})Laravel 10 and below (App\Exceptions\Handler::register()):
$this->reportable(
fn (Throwable $e) => \ErrTap\ErrTap::captureException($e)
);Manual capture and logs
\ErrTap\ErrTap::captureMessage('payment fallback used', [
'level' => 'warning',
'tags' => ['flow' => 'checkout'],
]);
\ErrTap\ErrTap::info('checkout started', ['orderId' => $order->id]);
// debug(), warning(), and error() are also available.Cron heartbeats
The Laravel package does not export a heartbeat helper. Create a monitor under Cron, copy its generated ping URL, and POST it only after a successful job:
use Illuminate\Support\Facades\Http;
$schedule->command('invoices:generate')->daily()->onSuccess(
fn () => Http::post(config('services.errtap.invoice_heartbeat_url'))
);The generated token in that URL authenticates the heartbeat; no DSN header is required.
Release and environment
Set ERRTAP_ENV and ERRTAP_RELEASE before Laravel boots. The service provider
passes both to every event and log; release values enable regression detection.