Migrating from Laravel Pint
Laravel Pint formats code with its laravel preset, and the laravel standard of
DressCode has the same style. Migrating takes one line of configuration, which dresscode init writes by itself in a
project with Pint, and the same run that formats your code can also upgrade it to a newer PHP and Laravel.
Why DressCode Instead of Pint
Pint is a command-line tool of its own, built on PHP CS Fixer, with its own presets. The default one, laravel, is
a list of fixers it runs on your code. DressCode carries that list as the laravel standard, so it leaves code that
Pint formatted almost unchanged. This was verified on fourteen Laravel packages, 1,615 files run through Pint 1.32:
dresscode check --use laravel found 129 places in them, and each of them is one of the differences described below
(October 2026).
What you get in addition:
- Upgrading in the same run. The
modernizationsset rewrites code to the constructs of a newer PHP version,deprecationsfixes what PHP has deprecated, and thedresscode/upgrade-laravelpackage rewrites the API that Laravel changed between versions. See Upgrading to a Newer PHP and Laravel. - Class names in phpDoc are imported in every tag, even in
@templateand@method, where Pint leaves them fully qualified. - Output for AI agents and editors. The
agentformat tells an AI agent what changed in a file after the agent edited it, so that its next edit does not fail. See AI agents.
Converting
In a project that requires laravel/pint or has a pint.json, dresscode init writes the standard that matches the Pint preset by
itself; for the default laravel preset, it prints:
Standard laravel, the style of Laravel Pint, which the project formats with; `--use` writes another
A configuration written by hand is one line:
use: laravel
If your pint.json has extra rules in its rules key on top of the preset, rewrite them into the
configuration by hand. DressCode knows the fixer names: dresscode catalogue lists, for every decision, the PHP CS
Fixer fixers it covers, so you will find no_unused_imports as imports.unused. The exclude
key belongs in excludePaths, see Configuration.
| Pint | DressCode |
|---|---|
pint |
dresscode fix |
pint --test |
dresscode check |
pint app/Models |
dresscode fix app/Models |
pint --preset laravel |
dresscode fix --use laravel |
Where DressCode Differs from Pint
On code that Pint formatted, you will run into these differences:
- DressCode shortens and imports a class name in a doc comment in every tag; Pint does it only in the tags its
fully_qualified_strict_typeslists, which means not in@templateor@method. - DressCode merges two blank lines in a row inside a doc comment into one. Pint trims only its start and end.
- DressCode removes an import whose name appears only in the text of a comment, as unused. Pint keeps it.
- In a comparison of a literal with a constant,
'\\' === DIRECTORY_SEPARATOR, DressCode puts the constant on the left. Pint leaves both sides as they are. - Line endings follow the majority in the file (
file.lineEnding: majority), so a project on Windows with CRLF stays with CRLF. Pint writes LF.
And here is what Pint does and DressCode does not do yet: renaming test methods to snake_case
(php_unit_method_casing), sorting traits (ordered_traits), and aligning or sorting phpDoc tags
(phpdoc_align, phpdoc_order, phpdoc_separation). The page Standards and Sets shows the whole preset, with comments.