定制 codevioso/laravel-doctor 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

codevioso/laravel-doctor

Composer 安装命令:

composer require codevioso/laravel-doctor

包简介

Lightweight diagnostic tool for Laravel apps

README 文档

README

Laravel Doctor

Instantly diagnose configuration, performance and production safety issues in your Laravel application.

📄 View the landing page →

Tests Latest Version Downloads License

Introduction

Laravel Doctor is a CLI tool that scans your Laravel application for common configuration mistakes, performance anti-patterns, and production safety issues. It runs a set of checks against your app config, environment, and filesystem and reports findings with actionable messages.

Production misconfigurations—debug mode enabled, file-based cache in production, sync queue driver, missing storage symlink—are easy to overlook but costly in production. Laravel Doctor surfaces these issues before they impact users or performance. It verifies cache state, driver choices, file permissions, PHP extensions, and more.

Run it locally. No external services, no API calls, no network dependencies.

php artisan doctor:check

Installation

composer require codevioso/laravel-doctor

Optionally publish the config file:

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

Usage

php artisan doctor:check

Run only specific checks:

php artisan doctor:check --only=ConfigCacheCheck

Skip checks:

php artisan doctor:check --skip=RouteCacheCheck,ViewCacheCheck

Demo report (sample output, no real checks):

php artisan doctor:check --demo

Example Output

Laravel Doctor Report
=====================

Errors: 1 | Warnings: 2 | Suggestions: 1 | Passed: 10

Errors:
--------
APP_DEBUG is enabled in production. Set APP_DEBUG=false.

Warnings:
---------
Cache driver is file in production. Use redis/memcached/database for better performance.
Config is not cached. Run: php artisan config:cache

Suggestions:
-----------
Cannot verify queue worker process from PHP. Ensure a supervisor/systemd process runs: php artisan queue:work

Passed:
--------
APP_ENV matches the environment.
Route cache not required for this environment.
View cache not required for this environment.
Queue driver is not sync in production.
Session driver is not file in production.
Storage symlink exists.
Log channel is appropriate for environment.
Composer autoload optimization not required for this environment.
All required PHP extensions are available.
Storage and bootstrap/cache directories are writable.

Completed in 45 ms
Fix errors first, then rerun.

Included Checks

  • APP_DEBUG in production
  • APP_ENV mismatch
  • Config cache
  • Route cache
  • View cache
  • Queue sync driver in production
  • Queue worker detection
  • Cache driver in production
  • Session driver in production
  • Storage symlink
  • File permissions
  • Composer optimized autoload
  • Required PHP extensions
  • Log channel configuration

Configuration

The config/doctor.php file controls which checks run and how. After publishing, you can:

  • Enable or disable the package: Set enabled to true or false.
  • Enable or disable individual checks: Use the checks array. Keys are check class names, values are true or false.
  • High-traffic flag: Set environment.high_traffic to true to enable additional logging-related checks.
  • Custom checks: Add class names to the custom_checks array to run your own checks (they are enabled by default).

Extending (Custom Checks)

Register your own checks by implementing Codevioso\LaravelDoctor\Contracts\CheckInterface and registering them with the Doctor service:

use Codevioso\LaravelDoctor\Doctor;

public function boot()
{
    app(Doctor::class)->registerCheck(App\Doctor\MyCustomCheck::class);
}

Custom checks must implement CheckInterface, which defines key(), title(), and run(DoctorContext $context) returning a CheckResult.

Contributing

Contributions are welcome. Please submit a pull request on GitHub. Run tests before submitting (composer test) and follow the existing package architecture for checks and configuration.

Security

If you discover a security vulnerability, please report it privately via GitHub Security Advisories or contact the maintainers. Do not open a public issue.

License

The MIT License (MIT). Please see LICENSE for more information.

codevioso/laravel-doctor 适用场景与选型建议

codevioso/laravel-doctor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「performance」 「cli」 「laravel」 「diagnostics」 「artisan」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 codevioso/laravel-doctor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 codevioso/laravel-doctor 我们能提供哪些服务?
定制开发 / 二次开发

基于 codevioso/laravel-doctor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 23
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-11