Laravel Devtoolbox is a Swiss-Army knife artisan CLI for Laravel, created by Jean-Marc Strauven. This package helps teams maintain code quality and gain a deeper understanding of their Laravel applications through automated analysis, offering features such as code review assistance, performance bottleneck detection, technical debt identification, and automatic documentation generation. It's particularly useful for onboarding new developers, establishing CI/CD quality gates, and monitoring application structure and health.
Main Features
- Deep Application Scanning - Complete analysis of models, routes, services, and more
- Model Introspection - Analyse 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
This package has numerous commands, but a few quick ones to try in your application are:
# Find where a model is usedphp artisan dev:model:where-used ModelName

# Trace SQL queries for a routephp artisan dev:sql:trace --route=games.index

# Analyse SQL queries for N+1 problems, duplicates, and performance issuesphp artisan dev:sql:duplicates --route=games.index

# Service provider performance analysisphp artisan dev:providers:timeline --slow-threshold=100

There are many more commands you can try, as well as various export formats.
Give it a try and install via Composer:
composer require --dev grazulex/laravel-devtoolbox
Learn more about this package in the official documentation and view the source code on GitHub.