- How do I install Laravel Doctor?
- Install it as a dev dependency with composer require laravel/doctor --dev. After Composer finishes, the package registers the doctor Artisan command, so no extra service wiring is needed. Then run php artisan doctor from your Laravel application root.
- How do I run Laravel Doctor and read its results?
- Run php artisan doctor. Each diagnostic checks one concern and reports a status; failing checks include remediation guidance, and fixable failures prompt before repair. Use --fix to apply available fixes without prompting.
- What does php artisan doctor --fix do?
- It applies every available first-party fix that does not require a choice, without prompting. That includes deterministic local repairs such as creating a missing .env, generating APP_KEY, disabling production debug mode, adding .env to .gitignore, creating the public storage link, and repairing writable storage. Fixes that require a choice are reported as ordinary failures with remediation text.
- Is Laravel Doctor safe to run in production?
- By default it is an inspection tool, and fixes only apply to explicitly fixable failures, with local environment gating and no prompting under --fix. However --fix mutates the application, so production use should be governed by policy. Because it is installed with --dev, composer install --no-dev would omit it; include it intentionally in staging or production-like environments if you need production-mode diagnostics.
- What problems can Laravel Doctor diagnose?
- It diagnoses common configuration, environment, and infrastructure concerns, such as missing .env, missing APP_KEY, debug mode, storage links, and writable storage directories. Each diagnostic inspects a single concern and reports a clear status. Failures that cannot be repaired safely, such as failed asset builds, are reported with remediation steps.
- Can I use Laravel Doctor in CI pipelines?
- Yes; exit-code semantics are explicit: pass, notice, and skip do not fail the run, while fail and error do, and warn fails only with --fail-on=warn. --bail stops on the first failure, and programmatic Doctor::bail()->run() supports PHP embedding. Results use stable machine-readable codes, which helps CI and agent tooling consume output without screen-scraping.
- How do I run only selected Laravel Doctor diagnostics?
- Use selector flags such as --only and --except by class, group, package, or wildcard. You can also publish a config file for persistent allowlists and map custom environment names to local or production mode. This lets teams keep a default suite while excluding checks that do not apply to their app.
- Does Laravel Doctor support custom diagnostics?
- Yes; the extension unit is a Diagnostic class with a declared name and group, a check() method returning a typed result, and an optional fix() behind the Fixable contract. Results are first-class objects such as DiagnosticResult, FixResult, Message, and Link rather than console strings. Teams should review custom diagnostics like application code because an uncaught exception inside one yields an error and fails the run.
- Is laravel/doctor mature enough to adopt?
- The design follows Laravel packaging conventions and has strong first-party stewardship, but observed ecosystem usage is very low: the evaluation cites 111 stars, 0 dependents, and a latest release dated 2026-07-28. Treat maturity, versioning, and the stability of the diagnostic API as open questions. Pilot it in CI or staging before making it a required pipeline gate.
- How does Laravel Doctor compare with Larastan, Pint, or dependency auditors?
- Laravel Doctor is not a static analyzer, formatter, or dependency auditor; it checks runtime configuration, environment, and infrastructure concerns and offers safe, deterministic fixes where available. It complements tools such as Larastan, Pint, and dependency auditors rather than replacing them. Define the division of labor so overlapping checks and failure ownership are clear.