Code style is often a battlefield. Every developer has an opinion on trailing commas, indentation, and brace placement. These debates eat time. They distract from shipping features and solving real problems.
Laravel Pint ends the argument. It is an opinionated, zero-configuration PHP code style fixer. Built on top of PHP-CS-Fixer, it simplifies the process of keeping your codebase clean. It handles the heavy lifting so you can focus on building.
Most modern Laravel applications include Pint by default. It fits perfectly into the ecosystem alongside tools like Octane and Horizon. If you aren't using it yet, it’s time to start.
Zero Configuration: Just Run It

Pint requires no initial setup. It ships with a default "Laravel" preset that follows the framework's internal coding standards. You don't need to define rules or choose between tabs and spaces manually.
To clean your code, run the binary from your terminal:
./vendor/bin/pint
Pint scans your project and fixes style issues immediately. It updates your files to match the standard. The output shows exactly which files were modified. It is fast, efficient, and deeply satisfying.
If you are working on a new project, Pint is already there. For existing projects, installation is a single command. Use Composer to bring it in as a development dependency.
composer require laravel/pint --dev
Exploring Presets: PSR-12 and Beyond

Not everyone follows the core Laravel style. Some teams prefer PSR-12 or the Symfony standard. Pint acknowledges this by offering built-in presets. You can switch styles without writing a single line of custom logic.
To run Pint with a specific preset, use the --preset flag:
./vendor/bin/pint --preset psr12
This flexibility makes Pint useful for any PHP project, not just Laravel applications. It bridges the gap between different community standards. You get the simplicity of a Laravel tool with the breadth of the wider PHP ecosystem.
You can also use the --test flag. This checks your code without changing it. It is perfect for a quick sanity check before you commit your work.
Customizing Rules with pint.json
Sometimes you need to deviate from the presets. You might want to enforce strict types or disable specific indentation rules. Pint allows this through a pint.json file in your project root.
A simple configuration looks like this:
{
"preset": "laravel",
"rules": {
"simplified_null_return": true,
"array_indentation": false,
"declare_strict_types": true
}
}
This file centralizes your team's style decisions. It prevents "style drift" as your team grows. When everyone uses the same pint.json, code reviews become about logic rather than syntax.
The tool remains lightweight even with custom rules. It doesn't bloat your project or slow down your workflow. It is the definition of "set it and forget it."
Automated Enforcement in CI

Manual runs are great, but automation is better. You should never merge unformatted code. Integrating Pint into your CI/CD pipeline ensures every pull request meets your standards.
Using GitHub Actions is the standard approach. You can create a workflow that runs Pint in test mode. If the code is messy, the build fails. This forces developers to clean up before their code hits production.
A basic GitHub Action step for Pint:
- name: Check Code Style
run: ./vendor/bin/pint --test
This simple check prevents technical debt from accumulating. It keeps the "boring" parts of development automated. This philosophy of stability and reliability is core to the Laravel 12 release.
The Power of Dirty Files
In large legacy codebases, running a full style fix can be overwhelming. It creates massive diffs that are hard to review. Pint solves this with the --dirty flag.
./vendor/bin/pint --dirty
This command only targets files that have uncommitted changes in Git. It lets you clean as you go. You improve the codebase incrementally without disturbing unrelated sections.
It is the best way to introduce Pint to an old project. You fix what you touch. Over time, the entire project reaches a consistent state without a single massive, disruptive PR.
Shipping with Confidence
Clean code is not just about aesthetics. It is about readability and long-term maintainability. When code follows a predictable pattern, bugs have fewer places to hide.
Laravel Pint removes the friction of maintaining these patterns. It provides a best-in-class developer experience. It is part of a full ecosystem designed to help you build and deploy modern applications rapidly.
Stop arguing about semicolons. Install Pint, set your preset, and get back to writing code that matters. Your future self: and your teammates: will thank you.
We would love to hear how you've integrated Pint into your workflow.