Getting started, how each piece fits together, and common configuration patterns.
composer require watchdog-ai/laravel php artisan migrate # Optional: publish config so you can edit it locally php artisan vendor:publish --tag=watchdog-ai-config
The package auto-loads its routes, migrations, and views via Laravel's package discovery — no config/app.php edits required.
Visit https://watchdog.sicl.ai/watchdog/settings and configure at least one provider:
Keys are encrypted at rest using your application's APP_KEY. Backups never contain plaintext.
Use the Watchdog facade anywhere in your app — controllers, services, jobs, middleware:
use WatchdogAI\Laravel\Facades\Watchdog;
Watchdog::error('PaymentService', 'charge_failed', $msg, $exception, [
'order_id' => $order->id,
]);
Watchdog::warning('OrderQueue', 'slow_job', "Job took {$ms}ms", ['job_id' => $jobId]);
Watchdog::info('Auth', 'login', "User {$user->id} signed in");
The package automatically captures the calling file and line number — no need to pass __FILE__ manually. Identical events within a 10-second window are deduped to avoid runaway logging.
By default, only the levels enabled on the baseline (*) row are recorded. To capture less or more, open the Watch list from the Events page. Adding any non-* service activates strict mode — only listed services are logged.
The watchdog-ai:monitor command pulls the last N minutes of events, sends them to the configured LLM, and stores the analysis. Schedule it in app/Console/Kernel.php:
$schedule->command('watchdog-ai:monitor')->everyTenMinutes();
Or run on demand:
php artisan watchdog-ai:monitor # default 10-min window php artisan watchdog-ai:monitor --minutes=60 # last hour php artisan watchdog-ai:monitor --dry-run # preview without LLM call php artisan watchdog-ai:monitor --provider=anthropic # one-off override
git apply or paste into your editor.Path safety: the resolver only reads files under app/, config/, routes/, database/ by default. Tweak in config/watchdog-ai.php → code_fix.allowed_paths. Any path containing .. is rejected outright; .env/.key/.pem extensions are blocked.
WATCHDOG_AI_LOG_PROVIDER=groq (cheap analysis) and WATCHDOG_AI_FIX_PROVIDER=anthropic (high-quality fixes) in .env.WATCHDOG_AI_LARAVEL_LOG_PATH=/path/to/laravel.log. Set to empty string to disable Laravel-log scanning entirely.WATCHDOG_AI_EVENT_RETENTION_DAYS=30 (default). Set to 0 to keep forever.One env line takes the package offline without uninstalling. Watchdog facade calls become no-ops, the cron exits 0 immediately, and the Suggest Fix endpoint returns 503:
WATCHDOG_AI_ENABLED=false php artisan config:cache
Re-enable by removing the line (or setting it to true) and re-running config:cache.