Looking to hire Laravel developers? Try LaraJobs

laravel-doctor maintained by flobbos

Description
A lightweight Laravel health score for CI and production readiness.
Last update
2026/08/09 12:06 (dev-main)
License
Links
Downloads
13

Comments
comments powered by Disqus

Laravel Doctor

A lightweight Laravel health score for CI and production readiness.

Looking for a comprehensive diagnostics and auto-repair suite? Use the official Laravel Doctor. This package intentionally stays focused on a compact, weighted score that is easy to read, share, and enforce in CI.

Laravel Doctor terminal report

Laravel Doctor

  ✓ APP_DEBUG    Disabled.
  ✓ APP_ENV      Set to production.
  ✓ Queue        Using the redis connection.
  ✓ Cache        Using the redis store.
  ✓ Config cache Configuration is cached.
  ! Route cache  Routes are not cached.
  ✓ OPcache      Enabled.
  ✓ Database     Connected via mysql.
  ✓ Migrations   No pending migrations.

  Score  96/100

Requirements

  • PHP 8.2+
  • Laravel 11, 12, or 13

Installation

composer require flobbos/laravel-doctor --dev

Laravel discovers the service provider automatically. Run the report with:

php artisan doctor

Use it in CI or deployments:

php artisan doctor --ci
php artisan doctor --minimum=80
php artisan doctor --json

--ci returns a non-zero exit code when a check fails. --minimum enforces a score from 0 to 100. --json returns the same report in a machine-readable format.

Publish the configuration when you want to customize the checks:

php artisan vendor:publish --tag=doctor-config

Custom checks

Implement LaravelDoctor\Contracts\Check and add the class to config/doctor.php:

use LaravelDoctor\Contracts\Check;
use LaravelDoctor\ValueObjects\CheckResult;

final class DatabaseCheck implements Check
{
    public function run(): CheckResult
    {
        return CheckResult::pass('Database', 'Connection is healthy.');
    }
}

The container resolves every check, so constructor injection works as expected. Results can be pass, warning, or fail. Passes earn full score, warnings half score, and failures no score.

Scoring weights

Published configuration includes a weights array keyed by check class. Increase a value when that check should contribute more heavily to the score:

'weights' => [
    AppDebugCheck::class => 2,
    DatabaseConnectionCheck::class => 3,
],

Development

composer install
composer test
composer format

License

MIT