autoheal / laravel-sdk
Reports exceptions, error logs, deployments, heartbeats and health checks from a Laravel application to AutoHeal.
Requires
- php: ^8.3
- illuminate/console: ^11.0|^12.0|^13.0
- illuminate/http: ^11.0|^12.0|^13.0
- illuminate/routing: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.27
- opis/json-schema: ^2.4
- orchestra/testbench: ^11.0
- pestphp/pest: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Reports a Laravel application's exceptions, error logs, deployments, heartbeats and health checks to AutoHeal. It also offers a cache hook the AutoHeal agent can call during recovery. It is built so that AutoHeal can never slow the application down, break it or leak its secrets.
Requirements
PHP 8.3 or later, and Laravel 11, 12 or 13.
Install
composer require autoheal/laravel-sdk
Quick start
Set AUTOHEAL_ENDPOINT and AUTOHEAL_KEY in .env. The key comes from the environment's page in the AutoHeal dashboard. Without both, the SDK does nothing.
AUTOHEAL_ENDPOINT=https://autoheal.example.com/api/v1 AUTOHEAL_KEY=<your SDK key>
Check the connection:
php artisan autoheal:test
Exceptions and error logs now reach AutoHeal. Deployments, heartbeats and health checks are shown below and in Events and commands.
Documentation
- Configuration: every key, its environment variable and default.
- Events and commands: what is reported, the artisan commands and the facade.
- Cache hook: let the agent clear a cache during recovery.
- Delivery: when events are sent, queued delivery, outages and what is never sent.
- Troubleshooting: command messages and common problems.
- Development: tests, Pint, PHPStan and the sample application.
- Changelog
Optional variables, heartbeats, deployments and health checks
Optional variables: AUTOHEAL_RELEASE, AUTOHEAL_SERVICE, AUTOHEAL_TRANSPORT (http or queue), AUTOHEAL_LOG_LEVEL (default error) and AUTOHEAL_ENABLED. To change other defaults, publish the configuration:
php artisan vendor:publish --tag=autoheal-config
Send a heartbeat from the scheduler:
// routes/console.php Schedule::command('autoheal:heartbeat scheduler --every=60')->everyMinute();
Report deployments and health checks from a pipeline or your own checks:
php artisan autoheal:deploy 2026.11.06-1 --source=github-actions php artisan autoheal:health database degraded --latency=840
License
MIT. See LICENSE.