glhd/laralint
Laralint is a Laravel-aware linting package that scans your codebase for common mistakes, anti-patterns, and convention violations. It helps catch issues early with configurable rules and simple commands that fit into your existing development workflow.
Install as a dev dependency:
composer require glhd/laralint --dev
Run the linter directly:
vendor/bin/laralint
Start with a single directory or file to see the kinds of issues it flags before running it across the whole codebase:
vendor/bin/laralint app/Http/Controllers
Look first at the generated/published config (if you need to customise rules). Publish it with:
php artisan vendor:publish --tag=laralint-config
The first practical use case is auditing an existing Laravel project for common anti-patterns (e.g. env() calls outside config, missing declare(strict_types=1), incorrect facade usage) and then wiring the command into CI so new violations don’t creep in.
vendor/bin/laralint --no-progress to your GitHub Actions / GitLab CI pipeline. Fail the build on violations so the ruleset becomes enforceable.git diff --name-only or a CI helper.--baseline) so existing violations are ignored and only new ones fail the build.vendor/bin/laralint on staged files before commit.^0.1 until you upgrade. The package generally follows Laravel’s major releases, so keep it in sync with your framework version.true enables a rule and false disables it. Double-check the exact key names; typos are silently ignored in some linter implementations.-v (or --debug where available) to see which rules are being applied and why a file is flagged. If a rule seems missing, confirm it’s enabled and that the file path matches the rule’s scope.App\Support\Laralint) and cover them with tests.app/, src/) and exclude vendor/generated directories in the config.How can I help you explore Laravel packages today?