codevioso/laravel-doctor
Composer 安装命令:
composer require codevioso/laravel-doctor
包简介
Lightweight diagnostic tool for Laravel apps
README 文档
README
Instantly diagnose configuration, performance and production safety issues in your Laravel application.
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
enabledtotrueorfalse. - Enable or disable individual checks: Use the
checksarray. Keys are check class names, values aretrueorfalse. - High-traffic flag: Set
environment.high_traffictotrueto enable additional logging-related checks. - Custom checks: Add class names to the
custom_checksarray 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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 codevioso/laravel-doctor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
g4 application profiler package
CSS/Javascript Minificator, Compressor and Concatenator for TYPO3 - highly configurable frontend asset optimization for CSS/JS merging, minification and compression with optional body parsing, async/defer loading, inline output, data-ignore exclusions, SRI integrity validation/calculation, external
WordPress mu-plugin to remove jQuery Migrate from the list of jQuery dependencies and to allow jQuery to enqueue before </body> instead of in the <head>.
Create link to static resources with cache-breaking segment based on md5 of the file
Production-ready Laravel Prometheus metrics package with built-in collectors for HTTP, database, cache, queue, events, errors, filesystem, and mail monitoring
Slim starter / Slim skeleton package to boost your development with Slim framework
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-11
