nunomaduro/phpinsights
PHP Insights analyzes PHP code quality, style, architecture, and complexity from your terminal. Works out of the box with Laravel (artisan insights), Symfony, Yii, Magento, and more, with built-in checks for reliability and loose coupling.
dd() in production code).LineLengthSniff—here’s how to fix it").final classes in our monorepo").ForbiddenPrivateMethods)."PHP Insights is a self-healing code quality assistant that catches bugs, style issues, and architectural problems before they reach production. Think of it as a linter for your entire codebase—like ESLint for JavaScript, but for PHP/Laravel. It integrates seamlessly into our workflow, reducing rework costs by automating 80% of manual code reviews. For example, it can block PRs with dd() calls in production code or flag overly complex classes that slow down development. The ROI? Fewer bugs, faster onboarding, and happier devs—all for the cost of a single composer require."
Key Metrics to Track:
*"This is a developer productivity multiplier. PHP Insights gives our team:
str_replace in business logic’) without reinventing the wheel.Implementation Plan:
Trade-offs:
phpinsights.php).*"This is like GitHub Copilot for code quality—it tells you exactly what’s wrong and how to fix it, without you having to read a 50-page style guide. Here’s how it helps you:
LineLengthSniff or UnusedParameter issues automatically.dd() in a controller or violating our service-layer conventions.foreach loops in our codebase? We can add it in 5 minutes.How to Use:
composer require nunomaduro/phpinsights --dev./vendor/bin/phpinsights (or php artisan insights for Laravel).Pro Tip: Add it to your package.json scripts so you can run npm run check:php alongside your frontend linters!"*
How can I help you explore Laravel packages today?