Introduction
laravel/doctor is an official Laravel package that diagnoses common configuration, environment, and infrastructure problems in your application. v0.1.0 was released on July 28, 2026. Each diagnostic is a single check — it inspects one thing, such as whether Laravel can write to its storage directories, and reports one of several statuses. When the repair is safe and deterministic, a diagnostic may also offer a fix. Issues that cannot be repaired safely, such as a failed asset build, are reported with remediation steps instead.Running Doctor
Once installed, the package registers thedoctor Artisan command:
--fix option:
.env, generating APP_KEY, disabling production debug mode, adding .env to .gitignore, creating the public storage link, and repairing writable storage directories.
Fixes are only available with the CLI and agent output formats. Doctor rejects
--fix with JSON and GitHub report formats so machine-readable reports never mutate the application.--bail to stop after the first diagnostic that fails or errors:
Diagnostic Statuses
Every diagnostic returns one of the following statuses:
By default, the command exits with a failing status when a diagnostic fails or errors. Use
--fail-on=warn to also fail on warnings, or --fail-on=never when Doctor should only report issues.
Selecting Diagnostics
Diagnostics may be selected or excluded by class name, group, package, or package wildcard. Multiple values may be passed by repeating the option or separating values with commas.Environment Modes
Some facts about an application cannot be judged on their own. Async queue connection is sensible on a developer’s machine, but in production it means queued jobs silently run inside web requests. To judge these diagnostics, Doctor resolves the application to one of two modes:
The mode changes the verdict, not just the message. Missing bootstrap caches warn in production but pass locally.
Doctor recognizes Laravel’s conventional
local, production, and staging environment names out of the box. For custom names, group them in the configuration file:
production, so unfamiliar environments are held to the strictest expectations rather than quietly excused.
Default Diagnostics
Doctor ships with a focused suite of diagnostics:- Environment —
.envpresence,APP_KEY, PHP version, required extensions, and timezone. - Composer — dependencies installed, autoload optimization, repairable
composer.lockproblems. - Configuration — config files can be loaded and cached, required values are set, bootstrap cache state matches the environment.
- Database — default connection is reachable, SQLite file exists when needed, pending migrations can be applied in local environments.
- Cache, queue, scheduler, and session — configured drivers are reachable,
syncqueues are flagged outside local environments, scheduled tasks are surfaced as a notice. - Storage — default disk is reachable, required directories are writable,
storage:linkexists when expected. - Security — debug mode matches the environment,
.envis gitignored, Composer dependencies are audited.
Creating Diagnostics
A diagnostic extendsLaravel\Doctor\Diagnostic and implements a check() method returning a DiagnosticResult. Scaffold one with the make:diagnostic Artisan command:
Fixable to generate it automatically:
fixOptions(). The CLI renders them as a select list, and the chosen value is passed to fix():
Running Doctor Programmatically
CallDoctor::run() without the Artisan command to get a DiagnosticReport:
fixUsing:
Output Formats and AI Agent Support
Doctor renders readable CLI output by default. JSON and GitHub Actions annotations are also available:fixable may be fixed by re-running Doctor with --fix. An explicit --format option always overrides detection. To preview agent output outside an agent:
Summary
laravel/doctor lets you quickly surface configuration, environment, and infrastructure problems with a single php artisan doctor command. Its deep integration with AI coding agents and the Laravel PAO convention makes it a natural fit for CI/CD pipelines and agent-driven auto-repair workflows.
laravel/doctor repository
Source code and latest updates.