PHPackages                             self-heallm/laravel-self-heallm - 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. self-heallm/laravel-self-heallm

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

self-heallm/laravel-self-heallm
===============================

Laravel package for automated error triage and LLM-powered self-healing.

v0.4.0(2mo ago)02MITPHP ^8.2

Since May 5Compare

[ Source](https://github.com/universe-coder/laravel-self-heallm)[ Packagist](https://packagist.org/packages/self-heallm/laravel-self-heallm)[ RSS](/packages/self-heallm-laravel-self-heallm/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependencies (7)Versions (5)Used By (0)

Laravel Self-HeaLLM
===================

[](#laravel-self-heallm)

[![Latest Version](https://camo.githubusercontent.com/c800fb0a2f463182def2afff72dccfe028a61a033078a4a38917747c463a3b14/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73656c662d6865616c6c6d2f6c61726176656c2d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/self-heallm/laravel-self-heallm)[![License](https://camo.githubusercontent.com/474c090e41d5a791074b9ddbc0367e0cab7855026e7796bc78f00ca5ca4bbdcd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73656c662d6865616c6c6d2f6c61726176656c2d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/e474484a0a0bc991dfcf2d88a41694d44ac920ae0139c9a493835ff0a68c922a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f73656c662d6865616c6c6d2f6c61726176656c2d73656c662d6865616c6c6d2f7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/self-heallm/laravel-self-heallm)[![Laravel](https://camo.githubusercontent.com/3d4c0dd8fb4fecfe8d133460e2f2ef4ca17c96b3a19d6d96b00bfa8b4e37b87d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f73656c662d6865616c6c6d2f6c61726176656c2d73656c662d6865616c6c6d2f696c6c756d696e617465253246737570706f72742e7376673f6c6162656c3d6c61726176656c267374796c653d666c61742d737175617265)](https://packagist.org/packages/self-heallm/laravel-self-heallm)[![Total Downloads](https://camo.githubusercontent.com/922a34c2abdf28cabb243f25166a237206ac5b339bd31200666378c5961595c3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73656c662d6865616c6c6d2f6c61726176656c2d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/self-heallm/laravel-self-heallm)[![Monthly Downloads](https://camo.githubusercontent.com/a1908cd1b5922a24634cdc972d4899c6a8d0963cca1649e41f8cfd576041b605/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f73656c662d6865616c6c6d2f6c61726176656c2d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/self-heallm/laravel-self-heallm)[![GitHub Stars](https://camo.githubusercontent.com/334de2d4852b7d64e6322a9b8c83051cd1f30e050764204b8017df3c4d039193/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f756e6976657273652d636f6465722f6c61726176656c2d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://github.com/universe-coder/laravel-self-heallm/stargazers)[![Last Commit](https://camo.githubusercontent.com/37554df95efb6830e92f27ee1afaea5b605d3445e0874f61cb2c2b670c5ad064/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f756e6976657273652d636f6465722f6c61726176656c2d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://github.com/universe-coder/laravel-self-heallm/commits/main)[![Open Issues](https://camo.githubusercontent.com/e9a82fdff83c47759b42569e01b908e910a643941f3ca8c7007e7ccaef946b02/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f756e6976657273652d636f6465722f6c61726176656c2d73656c662d6865616c6c6d2e7376673f7374796c653d666c61742d737175617265)](https://github.com/universe-coder/laravel-self-heallm/issues)

Open-source Laravel package that detects recent application errors, asks an LLM for a fix proposal (OpenAI, Anthropic, Hugging Face, or Ollama), validates safety rules, applies fixes in hybrid mode, and sends healing reports.

What It Does
------------

[](#what-it-does)

- Detects recent app errors and builds a repair context.
- Requests a fix proposal from a configured LLM provider.
- Validates proposed changes against strict safety rules.
- Applies validated fixes in `dry-run` or auto-apply mode.
- Sends reports to chat/monitoring channels.

Quick Start
-----------

[](#quick-start)

### 1) Install

[](#1-install)

```
composer require self-heallm/laravel-self-heallm
php artisan vendor:publish --tag=self-heal-config
```

### 2) Configure

[](#2-configure)

Main config file: `config/self-heal.php`

Supported sections:

- Provider selector: `llm.provider` (`openai`, `anthropic`, `huggingface`, `ollama`)
- OpenAI: `openai.base_url`, `openai.token`, `openai.model`, `openai.timeout`
- Anthropic: `anthropic.base_url`, `anthropic.token`, `anthropic.model`, `anthropic.timeout`, `anthropic.version`
- Hugging Face (OpenAI-compatible endpoint): `huggingface.base_url`, `huggingface.token`, `huggingface.model`, `huggingface.timeout`
- Ollama (OpenAI-compatible endpoint): `ollama.base_url`, `ollama.token`, `ollama.model`, `ollama.timeout`
- Telegram: `telegram.bot_token`, `telegram.user_id`, `telegram.enabled`
- Slack: `slack.enabled`, `slack.webhook_url`
- Generic webhook: `webhook.enabled`, `webhook.url`, `webhook.token`
- Sentry: `sentry.enabled`, `sentry.dsn`, `sentry.environment`
- Modes: `enabled`, `auto_apply`, `dry_run`
- Safety: `allowed_paths`, `forbidden_paths`, `max_files_per_fix`
- Deduplication: `deduplication.enabled`, `deduplication.ttl_seconds`, `deduplication.store_path`
- Model context size: `context.max_file_chars`
- Reporting: JSONL fallback path via `reporting.json_path`

Example `.env` values:

```
SELF_HEAL_ENABLED=true
SELF_HEAL_AUTO_APPLY=false
SELF_HEAL_DRY_RUN=true
SELF_HEAL_LLM_PROVIDER=openai
SELF_HEAL_OPENAI_BASE_URL=https://api.openai.com/v1
SELF_HEAL_OPENAI_TOKEN=sk-...
SELF_HEAL_OPENAI_MODEL=gpt-4.1-mini
SELF_HEAL_ANTHROPIC_BASE_URL=https://api.anthropic.com/v1
SELF_HEAL_ANTHROPIC_TOKEN=
SELF_HEAL_ANTHROPIC_MODEL=claude-3-5-sonnet-latest
SELF_HEAL_HUGGINGFACE_BASE_URL=https://router.huggingface.co/v1
SELF_HEAL_HUGGINGFACE_TOKEN=
SELF_HEAL_HUGGINGFACE_MODEL=openai/gpt-oss-120b
SELF_HEAL_OLLAMA_BASE_URL=http://localhost:11434/v1
SELF_HEAL_OLLAMA_TOKEN=
SELF_HEAL_OLLAMA_MODEL=llama3.1
SELF_HEAL_TELEGRAM_BOT_TOKEN=123:abc
SELF_HEAL_TELEGRAM_USER_ID=123456789
SELF_HEAL_SLACK_ENABLED=false
SELF_HEAL_SLACK_WEBHOOK_URL=
SELF_HEAL_WEBHOOK_ENABLED=false
SELF_HEAL_WEBHOOK_URL=
SELF_HEAL_WEBHOOK_TOKEN=
SELF_HEAL_SENTRY_ENABLED=false
SELF_HEAL_SENTRY_DSN=
SELF_HEAL_DEDUP_ENABLED=true
SELF_HEAL_DEDUP_TTL_SECONDS=600
SELF_HEAL_CONTEXT_MAX_FILE_CHARS=12000
```

Provider notes:

- `openai`: default provider, no migration needed for existing setups.
- `anthropic`: uses native Anthropic Messages API.
- `huggingface`: in this version, use an OpenAI-compatible Hugging Face endpoint.
- `ollama`: in this version, use Ollama's OpenAI-compatible endpoint (`/v1/chat/completions`).

### 3) Run

[](#3-run)

```
php artisan self-heal:run
```

Security Model
--------------

[](#security-model)

- Accepts fixes only for whitelisted paths.
- Rejects forbidden paths even if suggested by the model.
- Rejects empty replacement targets.
- Applies validated patches automatically only with `dry_run=false` and `auto_apply=true`.
- Skips duplicate error fingerprints during deduplication TTL.

Reporting Channels
------------------

[](#reporting-channels)

- Telegram notifications.
- Slack incoming webhook notifications.
- Generic webhook (`POST`) notifications.
- Sentry envelope event reporting.
- JSON fallback report when enabled.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance85

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

78d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22217470?v=4)[Pavel Sergeev](/maintainers/universe-coder)[@universe-coder](https://github.com/universe-coder)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/self-heallm-laravel-self-heallm/health.svg)

```
[![Health](https://phpackages.com/badges/self-heallm-laravel-self-heallm/health.svg)](https://phpackages.com/packages/self-heallm-laravel-self-heallm)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M246](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77922.3M186](/packages/laravel-mcp)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)[illuminate/queue

The Illuminate Queue package.

20432.6M1.7k](/packages/illuminate-queue)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
