# errorgap for Laravel

See [index.md](./index.md) for API details and the placeholder values (`ERRORGAP_API_KEY`, `ERRORGAP_ENDPOINT`, `ERRORGAP_PROJECT_SLUG`).

SDK source: `github.com/errorgaphq/errorgap-laravel` · current version: `0.2.0`.

## Install

```sh
composer require errorgap/laravel
```

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

## Configure

Publish the config:

```sh
php artisan vendor:publish --tag=errorgap-config
```

Add to `.env` (and `.env.example` with empty values):

```sh
ERRORGAP_ENDPOINT=https://errorgap.example.com
ERRORGAP_PROJECT_SLUG=your-project
ERRORGAP_API_KEY=...
```

Do not hardcode the key. The package auto-binds into the Laravel exception handler (preferring `reportable()` on Laravel 8+) and listens for `JobFailed` queue events.

## Trigger a test error

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

Visit `/errorgap-test`, then remove the route.

## Verify

Run the verification curl from [index.md](./index.md) and confirm HTTP 201 with a `group_id`. Then trigger the test error above and confirm the errorgap onboarding screen advances.
