Download the PHP package derkekser/laravel-paladin without Composer
On this page you can find all versions of the php package derkekser/laravel-paladin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download derkekser/laravel-paladin
More information about derkekser/laravel-paladin
Files in derkekser/laravel-paladin
Package laravel-paladin
Short Description Autonomous self-healing for Laravel applications using AI
License MIT
Homepage https://github.com/DerKekser/laravel-paladin
Informations about the package laravel-paladin

🛡️ Laravel Paladin
Autonomous Self-Healing for Laravel Applications
Laravel Paladin is an intelligent Laravel package that monitors your application logs, detects errors, and automatically attempts to fix them using AI-powered code generation. It creates isolated git worktrees for each fix attempt, runs tests to verify the fixes, and creates pull requests when successful.
Inspiration
This package was inspired by Taylor Otwell's demonstration of a self-healing Laravel application at Laracon 2025 in Amsterdam. After seeing the potential of AI-powered autonomous error fixing, I set out to build a practical implementation that any Laravel developer could use in their applications.
Documentation
For full documentation, visit https://derkekser.github.io/laravel-paladin-docs/
Features
- 🤖 AI-Powered Analysis: Supports multiple AI providers including OpenAI, Anthropic Claude, Google Gemini, and more
- 🔧 Autonomous Fixing: Leverages OpenCode to generate and apply fixes automatically
- 🌿 Safe Isolation: Each fix attempt runs in a separate git worktree
- ✅ Test Verification: Runs your test suite to ensure fixes don't break anything
- 🔄 Retry Logic: Configurable retry attempts with different approaches
- 📊 Multiple PR Providers: GitHub, Azure DevOps, or Email notifications
- 📝 Comprehensive Logging: Tracks all healing attempts in your database
- ⚡ Queued Processing: Runs in the background without blocking your application
Requirements
- PHP 8.2 or higher
- Laravel 11.x or 12.x
- Git installed and configured
- A git repository for your Laravel project
- AI provider API key (see supported providers below)
- (Optional) GitHub or Azure DevOps token for PR creation
Installation
1. Install the Package
2. Publish Configuration and Migrations
3. Run Migrations
4. Configure Environment Variables
Add the following to your .env file:
5. Configure Queue (Recommended)
Laravel Paladin runs as a queued job by default. Make sure you have a queue worker running:
Alternatively, configure your queue in config/queue.php to use database, Redis, or another driver.
Usage
Basic Usage
Run the self-healing process:
This will:
- Check for OpenCode and install it if needed
- Scan your application logs for errors
- Use AI to analyze and categorize issues
- Create a git worktree for each fix attempt
- Generate fixes using OpenCode
- Run your test suite to verify the fix
- Create a pull request (or send email notification) if successful
Synchronous Mode
To run the healing process synchronously (useful for debugging):
Check Healing Status
View the status of recent healing attempts:
Cleanup Old Worktrees
Clean up old worktrees to free disk space:
Scheduled Healing
Add to your app/Console/Kernel.php to run automatically:
Configuration
The configuration file config/paladin.php provides extensive customization options:
AI Evaluator Configuration
Laravel Paladin supports different AI evaluators and providers:
Evaluators:
laravel-ai(default) - Uses the Laravel AI SDK with multiple supported backendsopencode- Uses the OpenCode CLI directly for analysis (no API keys required)
Supported Providers (for laravel-ai evaluator):
anthropic- Claude models (requiresANTHROPIC_API_KEY)azure- Azure OpenAI (requiresAZURE_OPENAI_API_KEY,AZURE_OPENAI_ENDPOINT)cohere- Cohere models (requiresCOHERE_API_KEY)deepseek- DeepSeek models (requiresDEEPSEEK_API_KEY)gemini- Google Gemini (requiresGEMINI_API_KEY) - defaultgroq- Groq models (requiresGROQ_API_KEY)mistral- Mistral AI (requiresMISTRAL_API_KEY)ollama- Local Ollama models (optional:OLLAMA_BASE_URL)openai- OpenAI GPT models (requiresOPENAI_API_KEY)openrouter- OpenRouter (requiresOPENROUTER_API_KEY)xai- xAI models (requiresXAI_API_KEY)
Example Configurations:
Log Monitoring
Git Configuration
Pull Request Configuration
How It Works
- Log Scanning: Paladin scans your configured log channels for errors
- AI Analysis: Your configured AI provider analyzes each error and categorizes it by type and severity
- Prioritization: Issues are prioritized (critical → high → medium → low)
- Worktree Creation: A git worktree is created for isolated fix attempts
- AI Prompt Generation: The AI generates a detailed prompt for OpenCode
- Code Fixing: OpenCode applies the fix in the worktree
- Testing: Your test suite runs to verify the fix
- Pull Request: If tests pass, a PR is created (or email sent)
- Cleanup: The worktree is removed after completion
- Retry: If the fix fails, Paladin retries with a different approach (up to max attempts)
Database Tracking
All healing attempts are tracked in the healing_attempts table:
Security Considerations
- Git Credentials: Ensure your git credentials are properly configured for pushing to remote
- API Keys: Store all API keys in
.envand never commit them to version control - Access Tokens: Use tokens with minimal required permissions (repo access for GitHub, Code Write for Azure)
- Test Coverage: Maintain good test coverage to catch issues before fixes are merged
- Review PRs: Always review auto-generated PRs before merging
Troubleshooting
OpenCode Not Found
Paladin will automatically install OpenCode if it's not found. If installation fails, you can manually install it:
Git Worktree Issues
If worktrees aren't being cleaned up properly:
AI API Errors
- Verify your API key is correct for your chosen provider
- Check if you've exceeded API rate limits
- Ensure the model name is correct for your provider
- For specific provider issues, consult their documentation
Tests Not Running
- Ensure PHPUnit is installed:
composer require --dev phpunit/phpunit - Verify your test suite runs manually:
php artisan test - Check the
PALADIN_TEST_TIMEOUTif tests are timing out
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
The MIT License (MIT). Please see LICENSE file for more information.
Credits
- Built with Laravel AI SDK
- Built with Spatie Laravel Package Tools
- Code fixing by OpenCode
Support
For general support and questions, please use the GitHub Issues page.
All versions of laravel-paladin with dependencies
illuminate/contracts Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
illuminate/console Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/queue Version ^11.0|^12.0
laravel/ai Version ^0.3
guzzlehttp/guzzle Version ^7.0
spatie/laravel-package-tools Version ^1.16