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

Pint Laravel Package

laravel/pint

Laravel Pint is an opinionated PHP code style fixer built on PHP-CS-Fixer. It helps keep Laravel and PHP projects clean and consistent with minimal configuration, making it easy to enforce a unified coding style across your codebase.

View on GitHub
Deep Wiki
Context7

Laravel Pint is an opinionated PHP code style fixer for minimalists, designed to keep your codebase clean and consistent with minimal configuration. Built on top of PHP-CS-Fixer, Pint fits naturally into Laravel projects but works across modern PHP codebases.

Use Pint to standardize formatting, reduce style debates in reviews, and enforce a shared baseline locally or in CI.

  • Opinionated defaults for consistent formatting
  • Powered by PHP-CS-Fixer under the hood
  • Simple to run locally and in automated pipelines
  • Helps reduce noise in PRs by focusing on logic, not style
  • Lightweight, minimalist workflow for teams and solo devs
Frequently asked questions about Pint
How do I install Laravel Pint in my Laravel project?
Run `composer require laravel/pint --dev` in your project directory. Pint integrates seamlessly with Laravel via Artisan commands (`pint` or `pint:fix`), so no additional setup is needed for basic usage.
Does Laravel Pint work with Laravel 10+ and PHP 8.1+?
Yes, Pint is fully compatible with Laravel 10, 11, and PHP 8.1+. It’s actively maintained by the Laravel team and supports modern PHP features. Check the [Laravel Pint docs](https://laravel.com/docs/pint) for version-specific notes.
Can I use Pint alongside existing PHP-CS-Fixer configurations?
Yes, Pint is designed to work alongside PHP-CS-Fixer. Start with `pint --test` to compare output, then gradually migrate. Use the `--preset=laravel` or `--preset=empty` flags to align with your existing rules or adopt Pint’s opinionated defaults.
How do I enforce Pint in CI/CD pipelines?
Add Pint to your CI workflow (e.g., GitHub Actions) with `php artisan pint --test --with-exit-status`. Configure it to fail builds if style issues are found. Use `--dirty` to skip if no changes are detected, reducing noise in PRs.
What’s the difference between Pint’s ‘laravel’ and ‘empty’ presets?
The `laravel` preset enforces Laravel-specific rules (e.g., yoda conditions, indentation) for consistency with the framework. The `empty` preset applies minimal, universal PHP standards—ideal for non-Laravel projects or teams wanting a lightweight baseline.
Will Pint break my existing codebase if I run it for the first time?
Pint is designed to be non-breaking for well-formatted code. Run `pint --test` first to preview changes. If conflicts arise, use `--preset=empty` for a safer starting point or customize rules via PHP-CS-Fixer’s config.
How do I customize Pint’s rules beyond the presets?
Pint leverages PHP-CS-Fixer’s full rule set. Create a `.php-cs-fixer.dist.php` file in your project root to override defaults. For example, add `'rules' => [@Symfony => true]` to extend Pint’s behavior without replacing it entirely.
Does Pint support parallel processing for large codebases?
Yes, Pint enables parallel execution by default (since v1.16.0), significantly speeding up fixes for large projects. For monorepos, combine with `--cache-file` to cache results and reduce redundant processing.
How do I integrate Pint with PHPStorm or other IDEs?
Configure your IDE to use Pint’s rules by setting the PHP Code Sniffer path to Pint’s executable (e.g., `vendor/bin/pint`). In PHPStorm, go to *Settings > Languages & Frameworks > PHP > Code Sniffer* and point it to `vendor/bin/pint`. Some IDEs may require a refresh after fixes.
What alternatives to Pint should I consider for PHP code styling?
If Pint’s opinionated approach isn’t a fit, consider PHP-CS-Fixer directly for full customization or Prettier for JavaScript/TypeScript-heavy projects. For stricter PSR-12 compliance, use `php-cs-fixer` with a custom config. Pint’s advantage is its Laravel-specific optimizations and simplicity.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport