PHPackages                             pstoute/jarvis-error-reporter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. pstoute/jarvis-error-reporter

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

pstoute/jarvis-error-reporter
=============================

Send Laravel errors to Jarvis for automatic analysis and fixing

v1.0.2(4mo ago)01.2kMITPHPPHP ^8.1CI passing

Since Feb 1Pushed 4mo agoCompare

[ Source](https://github.com/pstoute/jarvis-error-reporter)[ Packagist](https://packagist.org/packages/pstoute/jarvis-error-reporter)[ RSS](/packages/pstoute-jarvis-error-reporter/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (4)Used By (0)

Jarvis Error Reporter
=====================

[](#jarvis-error-reporter)

A Laravel package that sends application errors to Jarvis for automatic analysis and fixing. Think Sentry, but with AI-powered auto-remediation.

Prerequisites
-------------

[](#prerequisites)

Before installing this package, you'll need:

1. **n8n Instance**: A running n8n server (cloud or self-hosted) to receive error webhooks and orchestrate the auto-fix workflow
2. **GitHub Access**: Your Laravel application must be in a GitHub repository with API access configured
3. **Claude Code Setup**: Claude Code CLI installed and configured to interact with your repositories
4. **Queue Workers** (Recommended): Laravel queue workers running for asynchronous error reporting
5. **NocoDB** (Optional): For tracking auto-fix attempts and outcomes

> **Note**: This package sends error data to YOUR infrastructure (n8n webhook), not a third-party service. You have complete control over your error data.

Installation
------------

[](#installation)

```
composer require pstoute/jarvis-error-reporter
```

Configuration
-------------

[](#configuration)

Add to your `.env` file:

```
JARVIS_DSN=https://n8ndomain/webhook/autofix
JARVIS_PROJECT=your-project-slug
JARVIS_ENVIRONMENT=production
JARVIS_ENABLED=true
```

That's it! Errors will automatically be captured and sent to Jarvis.

### Optional Configuration

[](#optional-configuration)

```
# Only auto-fix in specific environments (comma-separated)
JARVIS_AUTOFIX_ENVIRONMENTS=production,staging

# Sample rate (0.0 to 1.0) - useful for high-traffic apps
JARVIS_SAMPLE_RATE=1.0

# Include full source file contents (helps Claude understand context)
JARVIS_INCLUDE_SOURCE=true

# Lines of context around error
JARVIS_SOURCE_CONTEXT_LINES=20

# Rate limiting
JARVIS_RATE_LIMIT=true
JARVIS_RATE_LIMIT_PER_MINUTE=10
JARVIS_DEDUP_WINDOW=60

# Queue for async sending (set to empty/false for sync)
JARVIS_QUEUE=default

# HTTP timeout in seconds
JARVIS_TIMEOUT=5
```

### Publishing Config

[](#publishing-config)

To customize ignored exceptions or sensitive fields:

```
php artisan vendor:publish --tag=jarvis-config
```

### Test Your Installation

[](#test-your-installation)

Verify everything is configured correctly:

```
php artisan jarvis:test
```

This command will:

- Validate your configuration settings
- Send a test error to your n8n webhook
- Provide troubleshooting guidance if anything fails

Use the `--sync` flag to bypass the queue and send immediately:

```
php artisan jarvis:test --sync
```

Manual Usage
------------

[](#manual-usage)

### Capture an Exception Manually

[](#capture-an-exception-manually)

```
use Pstoute\JarvisErrorReporter\Facades\Jarvis;

try {
    // risky operation
} catch (Exception $e) {
    Jarvis::capture($e, ['operation' => 'import', 'batch_id' => $batchId]);
    throw $e; // or handle it
}
```

### Add Context

[](#add-context)

```
// In middleware or service provider
Jarvis::setUser(auth()->id(), auth()->user()->email)
    ->setContext([
        'tenant_id' => $tenant->id,
        'subscription_tier' => $tenant->plan,
    ]);
```

### Middleware Example

[](#middleware-example)

For multi-tenant applications or complex context tracking, create a middleware:

```
