zalanihir/deadcode-scanner
最新稳定版本:v1.0.0
Composer 安装命令:
composer require zalanihir/deadcode-scanner
包简介
Automatic dead code and route scanner for Laravel
README 文档
README
Automatic dead code and route scanner for Laravel applications.
Installation
composer require zalanihir/deadcode-scanner --dev
Laravel auto-discovers the service provider via extra.laravel.providers.
Optionally publish the config:
php artisan vendor:publish --tag=deadcode-config
Usage
php artisan deadcode:scan
Options:
--detailsShow counts and extra info--jsonOutput JSON report to stdout
What it checks
- Routes pointing to missing controllers/methods
- Unused public controller methods under
app/Http/Controllers - Unused Blade views (
resources/views) - Undefined routes referenced in Blade via
route('name')
Ignoring items
After publishing the config (config/deadcode.php):
return [ 'ignore' => [ 'routes' => [ // route names or URIs 'login', 'healthz', ], 'controllers' => [ // fully-qualified controller classes App\Http\Controllers\Internal\WebhookController::class, ], 'controller_methods' => [ // method names or FQCN::method 'helper', App\Http\Controllers\UserController::class . '::legacy', ], 'views' => [ // dot-notation view names 'errors::404', 'emails.welcome', ], ], ];
Notes
- Heuristics are conservative; review before deleting code.
- Scans only literal references (no runtime/generated view names).
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-09-21