emberrenewed / ai-error-laravel
Enterprise-grade AI-powered error analysis, monitoring and auto-fix suggestions for Laravel 13 applications. Combines Telescope-style observability with multi-provider AI (OpenAI, Gemini, Claude, Ollama).
v1.0.0
2026-05-27 03:20 UTC
Requires
- php: ^8.3
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.8
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/database: ^11.0|^12.0|^13.0
- illuminate/events: ^11.0|^12.0|^13.0
- illuminate/http: ^11.0|^12.0|^13.0
- illuminate/queue: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
Requires (Dev)
- laravel/pint: ^1.18
- mockery/mockery: ^1.6
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/phpstan: ^1.12
- phpunit/phpunit: ^11.0|^12.0
README
Laravel AI Error Analyzer
Telescope-grade observability + multi-provider AI explanations, root-cause analysis and auto-fix suggestions for Laravel 11/12/13.
β¨ Features
- π€ Multi-provider AI β OpenAI, Gemini, Claude, Ollama, plus custom drivers
- πͺ Beautiful dashboard β TailwindCSS + Alpine.js, dark mode, glassmorphism
- π Realtime β
ShouldBroadcastevents for Reverb / Pusher / Soketi - π§ Smart deduplication β fingerprint-based, identical errors share AI analysis
- π‘οΈ Security first β gated dashboard, encrypted runtime settings, redacted secrets
- π Notifications β Slack, Discord, Telegram, Mail with severity gating
- π§° Artisan kit β
install,test,scan,clear,analyze,monitor - π§ͺ Pest + PHPUnit β full test suite, GitHub Actions matrix
- π³ Docker β turnkey compose for local Ollama dev
π Quick start
composer require emberrenewed/ai-error-laravel php artisan ai-errors:install
AI_ERROR_ANALYZER_PROVIDER=openai OPENAI_API_KEY=sk-... AI_ERROR_ANALYZER_EMAILS=you@example.com
Run the queue worker that handles AI calls:
php artisan queue:work --queue=ai-errors
Visit /ai-errors in your browser. Done.
πΈ Screenshots
Drop screenshots into
docs/screenshots/and link them here:
docs/screenshots/
βββ overview.png
βββ error-detail.png
βββ chat.png
βββ settings.png
π§ What the AI returns
For every captured exception you get a structured analysis:
{
"summary": "Eloquent could not find a User with id 42.",
"root_cause": "The `firstOrFail()` call is hit when the requested user has been soft-deleted...",
"severity": "medium",
"suggested_fixes": ["Use `withTrashed()->find($id)`", "..."],
"example_code": "User::withTrashed()->findOrFail($id);",
"prevention_tips": ["Add a deleted-at index", "..."],
"documentation_links": ["https://laravel.com/docs/eloquent#soft-deleting"],
"security_warnings": [],
"performance_impact": null,
"auto_fix_patch": "--- a/app/Http/Controllers/UserController.php\n+++ b/...",
"related_files": ["app/Http/Controllers/UserController.php"]
}
ποΈ Architecture
ββββββββββββββββ Log::error ββββββββββββββββββββββββββ
β App code βββββββββββββββΆβ CaptureExceptionListenerβ
ββββββββββββββββ ββββββββββββ¬ββββββββββββββ
βΌ
ββββββββββββββββββββββββββββ
β ErrorAnalysisEngine β
β β’ build context β
β β’ fingerprint β
β β’ persist (repository) β
ββββββββ¬βββββββββββββ¬βββββββ
βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββ
β AnalyzeErrorJob β β ErrorCaptured β€ β broadcast
ββββββββββ¬ββββββββββ ββββββββββββββββββββ
βΌ
βββββββββββββββββββββββ
β AiProviderManager β β OpenAI / Gemini / Claude / Ollama
βββββββββββ¬ββββββββββββ
βΌ
ββββββββββββββββββββββ
β AiAnalysisResult β β Repository β ErrorAnalyzed event β Notifications
ββββββββββββββββββββββ
π§° Artisan commands
| Command | Description |
|---|---|
ai-errors:install |
Publish config/migrations and run them |
ai-errors:test |
Smoke-test the configured AI provider |
ai-errors:scan |
Backfill from storage/logs/laravel.log |
ai-errors:analyze {id} |
Re-run AI analysis on a specific log |
ai-errors:clear |
Purge logs older than retention |
ai-errors:monitor |
Tail recent errors in the terminal |
π‘οΈ Security
- Dashboard requires the
viewAiErrorAnalyzerGate (default: emails allow-list, local-only fallback). - API guarded by middleware + rate limiter.
- Secrets in
ai_error_settingsare encrypted viaAPP_KEY. - Secrets in payloads (
password,token,authorization, ...) are redacted before storage.
Read SECURITY.md for disclosure policy.
π€ Contributing
PRs welcome β see CONTRIBUTING.md. Please run:
vendor/bin/pint vendor/bin/phpstan analyse vendor/bin/pest
π License
MIT β see LICENSE.