Weave 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

Tlint Laravel Package

tightenco/tlint

Tlint is Tighten's opinionated command-line linter for Laravel projects. It checks PHP code against Laravel conventions and best practices, helping teams enforce consistent style, catch common issues early, and keep codebases clean and maintainable.

View on GitHub
Deep Wiki
Context7

TLint is a Laravel-focused linter from Tighten that checks your PHP code against community style conventions and fixes many issues automatically. Run tlint lint to scan for violations or tlint format to clean them up in place.

  • Enforces Laravel conventions like controller method ordering, model property order, and alphabetized imports
  • Auto-formats code with tlint format for quick fixes
  • Configurable via tlint.json, with presets and per-rule toggles
  • Supports tlint inspect for a readable summary and CI-friendly exit codes
Frequently asked questions about Tlint
What is tlint and what Laravel conventions does it check?
Tlint is a Laravel-specific linter from Tighten that checks PHP code against Laravel community conventions and best practices. It flags style and idiom issues such as fully qualified facades, anonymous migrations, request validation patterns, debug calls, and Blade directive spacing, and it can suggest or apply fixes. It is built on PHP Parser for AST-based analysis rather than regex, so it handles complex Laravel patterns more reliably.
How do I install and run tlint in a Laravel project?
Install it as a dev dependency with composer require --dev tightenco/tlint, then run ./vendor/bin/tlint from your project root. Use ./vendor/bin/tlint --fix to apply fixes automatically and add --preset=laravel to enforce the Laravel preset. It is CLI-driven, so no service provider registration or database setup is required.
How do I configure tlint for my team's Laravel style guide?
Tlint uses an optional tlint.json file for project configuration and supports built-in presets such as laravel. You can target specific checks with the --only flag or define custom presets when your team style guide diverges from Tighten defaults. Keep the config in version control so local runs, pre-commit hooks, and CI use the same rules.
Which Laravel and PHP versions does tlint support?
Tlint v9.x is aimed at modern Laravel projects, with Laravel 11 and later compatibility noted in the release line, and it requires PHP 8.1+ since v7 dropped PHP 7.3 and 7.4. Older Laravel or PHP stacks should verify Composer constraints and release notes before adopting the latest version. Because tlint is a CLI tool, support mainly depends on PHP and Symfony Process constraints rather than Laravel runtime bindings.
Can I run tlint in CI or a pre-commit hook?
Yes. Run ./vendor/bin/tlint --preset=laravel in CI, or use ./vendor/bin/tlint --fix in a pre-commit hook to apply safe fixes before code is committed. A typical GitHub Actions step is simply a run command pointing at the vendor binary. Gate merges on a clean lint run so convention drift is caught early.
What changed in tlint v9.7.0 regarding Symfony 8 and is upgrading safe?
Version 9.7.0 is a compatibility release that adds Symfony 8 support through Symfony Process, with no new linters, preset changes, or CLI changes. Upgrading is effectively zero effort: run composer update tightenco/tlint and expect no config or code changes. Projects on Symfony 6 or 7 are unaffected, but after a broad composer update validate the dev dependency tree with composer why symfony/process to ensure Symfony 8 was not pulled in unexpectedly.
Does tlint produce false positives with Blade directives or dynamic method calls?
Blade spacing linters such as SpacesAroundBladeRenderContent can conflict with custom directives, so test edge cases like @inject or @stack in your templates. Dynamic method calls were addressed in v9.6.1, but legacy code relying on __call or other magic methods may still trigger unexpected results. Use targeted --only runs and project config to suppress known exceptions, and report reproducible false positives upstream.
How can I improve tlint performance on a large Laravel codebase?
AST parsing is more accurate than regex but can be CPU-intensive on large codebases. Run tlint --profile to find slow linters, then use --only or presets to lint only relevant paths and rules in local loops. Keep full-project linting in CI and use targeted runs during development to reduce feedback time.
Should tlint be a dev dependency and does it affect production?
Install tlint with --dev because it is a development and CI tool, not a production runtime dependency. It does not add service providers, migrations, or database requirements, so it should not affect deployed application behavior. Keep it out of production installs with composer install --no-dev.
What are alternatives to tlint for Laravel code style, and is tlint maintained?
Common alternatives include Laravel Pint for formatting, PHP_CodeSniffer with Laravel rules, and PHP-CS-Fixer, while tlint focuses on Laravel-specific convention linting and targeted fixes. Tlint is maintained by Tighten and the v9.x line continues to receive compatibility updates such as Symfony 8 support. Evaluate it alongside your formatter rather than as a complete replacement, because linting conventions and formatting solve different problems.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager