Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Code Quality Pack

Code Quality Pack Laravel Package

setono/code-quality-pack

Laravel-friendly code quality pack with ready-to-use tools and config for static analysis, coding standards, refactoring, and CI checks. Helps keep projects consistent and maintainable with minimal setup, ideal for teams and shared repositories.

View on GitHub
Deep Wiki
Context7

A pack of libraries that adds code quality tools

Frequently asked questions about Code Quality Pack
What Laravel versions and PHP versions does this pack officially support?
The pack is optimized for Laravel 10+ and PHP 8.2+. While it may work with PHP 8.1 or Laravel 9.x, you’ll need to test compatibility manually, especially for Laravel-specific rules like Eloquent query analysis. Always check the package’s changelog for version-specific notes.
How do I integrate this into GitHub Actions for CI/CD?
Add a workflow step like `vendor/bin/code-quality-pack analyze --format=github` to your `.github/workflows/quality.yml`. For parallel execution, split files using `--paths` or leverage GitHub’s matrix strategy. Example: `paths: ['app/Http', 'app/Models']` to target critical directories first.
Can I customize rules for Laravel-specific patterns (e.g., Route::resource or HasFactory)?
Yes, the pack supports rule extensions via PHPStan’s configuration or Rector’s ruleset. Fork the package or override its `phpstan.neon`/`rector.php` to add Laravel-specific checks. For example, block unused `HasFactory` in models by extending SyliusLabs’ coding standard rules.
Will this conflict with existing tools like PHPStan or Psalm in my Laravel project?
Minimal risk if configured properly. The pack includes PHPStan by default, so avoid duplicate installations. Use `--ignore` flags or whitelist Laravel’s dynamic code (e.g., `app/Providers`) in `phpstan.neon`. For Psalm users, disable PHPStan’s rules to prevent redundancy.
How do I handle false positives for Laravel’s dynamic code (e.g., Blade templates or app/Providers)?
Whitelist paths in `phpstan.neon` under `[paths.whitelist]` or use `@ignore` annotations. For Blade templates, exclude `resources/views` unless you’ve added custom validation rules. Test with `--level=5 --memory-limit=1G` to catch edge cases before CI enforcement.
Does this pack include mutation testing (like Infection) for Laravel’s test suite?
Yes, Infection is included and pre-configured to analyze your PHPUnit tests. Run `vendor/bin/infection` in your project root to measure test quality. For Laravel, focus on critical paths like `tests/Feature` or `tests/Unit` to avoid excessive CI runtime.
Can I use this pack for refactoring legacy Laravel code (e.g., upgrading from PHP 7.4 to 8.2)?
Rector is included for safe refactoring, but test thoroughly. Start with `--dry-run` and target non-critical files first. For Laravel-specific upgrades (e.g., `collect()` to `Arr::`), extend Rector’s ruleset or use Laravel’s built-in `php artisan optimize` post-refactor.
How often are rules updated for new PHP/Laravel features (e.g., PHP 8.3 attributes or Laravel 11)?
The pack follows PHPStan/Rector’s release cycles, typically monthly. Laravel-specific updates lag behind but are addressed in minor versions. Monitor the [GitHub releases](https://github.com/Setono/code-quality-pack/releases) and contribute fixes if needed—it’s MIT-licensed.
Does this work with Laravel Forge/Envoyer for deploy-time analysis?
Not natively, but you can trigger analysis via Forge’s SSH tasks or Envoyer’s post-deploy hooks. Use `vendor/bin/code-quality-pack analyze --format=text` and pipe output to logs. For CI-like checks, add a custom recipe to your Forge server’s `deploy.php`.
What are the best alternatives if I only need static analysis for Laravel?
For lightweight analysis, use `phpstan/extension-installer` with a custom `phpstan.neon` targeting Laravel’s namespaces. For deeper integration, consider `nunomaduro/collision` (Laravel-specific linting) or `spatie/laravel-phpstan-rules`. This pack is ideal if you want a bundled solution with Infection, Rector, and dependency analysis.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed