grazulex/laravel-devtoolbox
Composer 安装命令:
composer require grazulex/laravel-devtoolbox
包简介
Swiss-army artisan CLI for Laravel — Scan, inspect, debug, and explore every aspect of your Laravel application from the command line.
README 文档
README
Swiss-army artisan CLI for Laravel — Scan, inspect, debug, and explore every aspect of your Laravel application from the command line.
✨ Features
Laravel Devtoolbox provides comprehensive analysis tools for Laravel applications:
- 🔎 Deep Application Scanning - Complete analysis of models, routes, services, and more
- 🧠 Model Introspection - Analyze Eloquent models, relationships, and usage patterns
- 🛣️ Route Analysis - Inspect routes, detect unused ones, and analyze middleware
- 📦 Service Container Analysis - Examine bindings, singletons, and providers
- ⚙️ Environment Auditing - Compare configuration files and detect inconsistencies
- 🔄 SQL Query Tracing - Monitor and analyze database queries for specific routes
- 📊 Multiple Export Formats - JSON, Markdown, Mermaid diagrams, and more
- 🛠 Developer Experience - Rich console output with actionable insights
📦 Installation
Install via Composer as a development dependency:
composer require --dev grazulex/laravel-devtoolbox
Requirements:
- PHP 8.3+
- Laravel 11.0+ | 12.0+
🚀 Quick Start
# See all available commands php artisan list dev: # Enhanced application overview (new!) php artisan dev:about+ --extended --performance # Quick health check of your application php artisan dev:scan --all # Find where a model is used php artisan dev:model:where-used App\Models\User # Detect unused routes php artisan dev:routes:unused # Find routes by controller (reverse lookup - new!) php artisan dev:routes:where UserController # Generate model relationship diagram php artisan dev:model:graph --format=mermaid --output=models.mmd # Trace SQL queries for a route php artisan dev:sql:trace --route=dashboard # Analyze SQL queries for N+1 problems (new!) php artisan dev:sql:duplicates --route=users.index --threshold=3 # Monitor logs in real-time (new!) php artisan dev:log:tail --follow --level=error # Compare environment files php artisan dev:env:diff --against=.env.example # Analyze database column usage php artisan dev:db:column-usage --unused-only # Security scan for unprotected routes php artisan dev:security:unprotected-routes --critical-only # Analyze container bindings (new!) php artisan dev:container:bindings --show-resolved # Service provider performance analysis (new!) php artisan dev:providers:timeline --slow-threshold=100 # Performance monitoring (new!) php artisan dev:performance:memory --route=dashboard php artisan dev:performance:slow-queries --threshold=1000 php artisan dev:cache:analysis --drivers=redis,file php artisan dev:queue:analysis --failed-jobs --slow-jobs
🔍 Available Commands
General Scanning & Analysis
dev:scan- Comprehensive application analysis with multiple scanner typesdev:about+- Enhanced version of Laravel's about command with extended information
Model Analysis
dev:models- List and analyze all Eloquent modelsdev:model:where-used- Find where specific models are useddev:model:graph- Generate model relationship diagrams
Route Analysis
dev:routes- Inspect application routesdev:routes:unused- Detect potentially unused routesdev:routes:where- Find routes by controller/method (reverse lookup)
Database Analysis
dev:db:column-usage- Analyze database column usage across the Laravel application codebasedev:sql:trace- Trace SQL queries for specific routesdev:sql:duplicates- Analyze SQL queries for N+1 problems, duplicates, and performance issues
Security Analysis
dev:security:unprotected-routes- Scan for routes that are not protected by authentication middleware
Service & Container Analysis
dev:services- Examine service container bindingsdev:container:bindings- Analyze container bindings, singletons, and dependency injection mappingsdev:providers:timeline- Analyze service provider boot timeline and performancedev:commands- List and analyze artisan commands
Middleware Analysis
dev:middleware- Analyze middleware classes and usagedev:middlewares:where-used- Find where specific middleware is used
View Analysis
dev:views- Scan Blade templates and views
Environment & Logging
dev:env:diff- Compare environment configuration filesdev:log:tail- Monitor Laravel logs with real-time filtering and pattern matching
Performance Analysis (new!)
dev:performance:memory- Analyze memory usage patterns and performancedev:performance:slow-queries- Detect and analyze slow database queriesdev:cache:analysis- Analyze cache performance and configurationdev:queue:analysis- Analyze queue performance, failed jobs, and job patterns
📊 Export Formats
All commands support multiple output formats:
| Format | Usage | Best For |
|---|---|---|
| Array/Table | --format=array (default) |
Interactive development |
| JSON | --format=json |
Automation, CI/CD |
| Count | --format=count |
Quick metrics |
| Mermaid | --format=mermaid |
Documentation, diagrams |
Save to Files
# Export to JSON php artisan dev:models --format=json --output=models.json # Generate Mermaid diagram php artisan dev:model:graph --format=mermaid --output=relationships.mmd # Save comprehensive scan php artisan dev:scan --all --format=json --output=app-analysis.json
🛠 Configuration
Publish the configuration file to customize behavior:
php artisan vendor:publish --tag=devtoolbox-config
This creates config/devtoolbox.php where you can customize:
- Default output formats
- Scanner-specific options
- Performance settings
- Export configurations
📚 Documentation
Comprehensive documentation and examples are available in our GitHub Wiki:
- Getting Started - Quick start guide
- Commands Reference - Detailed command documentation
- Configuration - Configuration options
- Examples & Use Cases - Practical usage examples
- CI/CD Integration - Automation workflows
- Output Formats - Export format examples
🔧 Examples & Automation
Daily Development Workflow
# Check application health php artisan dev:scan --all --format=count # Find cleanup opportunities php artisan dev:routes:unused php artisan dev:env:diff
CI/CD Integration
# Quality gates in CI UNUSED_ROUTES=$(php artisan dev:routes:unused --format=count | jq '.count') if [ $UNUSED_ROUTES -gt 10 ]; then echo "Too many unused routes: $UNUSED_ROUTES" exit 1 fi
Documentation Generation
# Generate project documentation
php artisan dev:models --format=json --output=docs/models.json
php artisan dev:model:graph --format=mermaid --output=docs/relationships.mmd
php artisan dev:routes --format=json --output=docs/routes.json
For complete automation scripts and CI/CD configurations, visit our Wiki Examples.
🔍 Use Cases
- 🔍 Code Reviews - Generate comprehensive application overviews
- 📊 Performance Analysis - Identify slow queries and bottlenecks
- 🧹 Technical Debt - Find unused routes, orphaned models, and inconsistencies
- 📖 Documentation - Auto-generate up-to-date application structure docs
- ⚡ CI/CD Quality Gates - Automated quality checks and thresholds
- 🎯 Onboarding - Help new team members understand application structure
🆕 Version Compatibility
| Laravel Devtoolbox | PHP Version | Laravel Version | Status |
|---|---|---|---|
| 1.x | 8.3+ | 11.x | 12.x | ✅ Active |
Note: This package now fully supports both Laravel 11 and Laravel 12, ensuring compatibility across the latest LTS and current releases.
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
📄 License
Laravel Devtoolbox is open-sourced software licensed under the MIT license.
Made with ❤️ for the Laravel community
Report Issues • Discussions • Wiki
💼 Need Expert Laravel Help?
Laravel DevToolbox is maintained by Jean-Marc Strauven, creator of 17+ Laravel packages with 6,000+ downloads.
🎯 Available for:
🏗️ Custom Laravel Development Build your application from scratch or extend existing systems with clean, maintainable code.
🔍 Code Audits & Architecture Review Deep analysis of your Laravel projects with detailed recommendations and refactoring roadmap.
- Complete codebase analysis
- Architecture documentation
- Performance bottleneck identification
- Security audit
- Duration: 2-3 days | Investment: €2,500
⚡ Performance Optimization Scale your Laravel application to handle millions of requests with confidence.
- Database query optimization
- Caching strategies
- Queue optimization
- Load testing and monitoring
📦 Custom Package Development Build tailored Laravel packages for your specific business needs.
- Internal tools and libraries
- API integrations
- Third-party service wrappers
- Investment: €5,000-€10,000
👨🏫 Team Training & Consulting Level up your team's Laravel skills with hands-on workshops and mentoring.
- Laravel best practices
- Clean architecture principles
- Testing strategies
- €1,500/day for team workshops
👨💻 Experience:
- 15+ years Laravel/PHP expertise
- Ex-CTO at Delcampe (marketplace with millions of users)
- Chapter Lead at BNP Paribas Fortis
- Creator of popular packages: DevToolbox, Atlas, ShareLink, Draftable
📬 Get in Touch:
- 📧 Email: jms@grazulex.be
- 💼 LinkedIn: Jean-Marc Strauven
- 🌐 Website: jnkconsult.be
- 💻 Malt Profile: Available for freelance projects
💡 Working on a complex Laravel project? Let's discuss how I can help you build better, faster, and more maintainable applications.
⭐ Support This Package
If Laravel DevToolbox saved you time and improved your workflow:
- ⭐ Star this repository — Help others discover it
- 🐦 Share it with your team and network
- 💖 Sponsor my work — Support continued development
Every star and sponsor helps me dedicate more time to maintaining and improving these tools for the Laravel community!
Created with ❤️ in Belgium 🇧🇪 by Jean-Marc Strauven
grazulex/laravel-devtoolbox 适用场景与选型建议
grazulex/laravel-devtoolbox 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.74k 次下载、GitHub Stars 达 155, 最近一次更新时间为 2025 年 07 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「debug」 「cli」 「laravel」 「inspector」 「scanner」 「artisan」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 grazulex/laravel-devtoolbox 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 grazulex/laravel-devtoolbox 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 grazulex/laravel-devtoolbox 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Debug your SimpleBus EventBus and CommandBus
nice output for debug functions for PHP 5.3
Analysis module for finding problematical shop data.
Twig extensions for Tracy Debugger
A package to integrate Elastic APM into Laravel
Exception monitoring and debug email channel for Filament.
统计信息
- 总下载量: 7.74k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 156
- 点击次数: 43
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-25
