laravel/pint
Laravel Pint is an opinionated PHP code style fixer for minimalists. Built on PHP-CS-Fixer, it makes it easy to keep your codebase clean and consistent with Laravel’s preferred formatting, for projects of any size.
artisan commands, CI/CD pipelines) and follows Laravel’s opinionated conventions (e.g., snake_case, PSR-12)../vendor/bin/pint
php artisan pint
Supports parallel processing (--parallel), diff mode (--diff), and CI-friendly flags (--with-exit-status)..php-cs-fixer.dist.php (standard PHP-CS-Fixer config).laravel, laravel-empty, per-cs).--parallel) mitigates runtime but may increase memory usage for large codebases.phpdoc_type_annotations_only) may conflict with existing PHP-CS-Fixer setups. Validation required during adoption.no_unneeded_import_alias) be validated?--parallel.)--preset=laravel or customize config.pre-commit (e.g., using Husky).--with-exit-status for failure handling.composer require --dev laravel/pint --with-all-dependencies
./vendor/bin/pint --test
--diff to review changes:
./vendor/bin/pint --diff
.php-cs-fixer.dist.php:
return [
'rules' => [
'@PER-CS' => true,
'no_unneeded_import_alias' => true,
],
'preset' => 'laravel',
];
./vendor/bin/pint --parallel --preset=laravel-empty
.editorconfig (use --config to override).php-cs-fixer commands).composer.json if needed:
"require-dev": {
"laravel/pint": "^1.29",
"friendsofphp/php-cs-fixer": "^3.87"
}
.php-cs-fixer.dist.php.--verbose for debug logs.--parallel --jobs=4).rm -rf ~/.cache/pint) if rules change.--dir to target specific folders.How can I help you explore Laravel packages today?