Format PHP with Pint before you commit

vendor/bin/pint --dirty formats the PHP you touched. It does not format Vue.

For your AI agent

Copies a prompt. Paste it into the AI agent you already have open.

Read https://laravel-vuejs.space/laravel-pint-before-commit.md
vendor/bin/pint --dirty formats the PHP you touched. It does not format Vue.
Do not add a PHP fixer inside a Vue file.
Show the diff. Do not commit.
On this page · 3 sections
  1. The fix
  2. What to avoid
  3. FAQ

People searching “Laravel Pint” run it with no arguments in a huge repo and then the diff is the whole framework style. Format what you changed. The tests guide is the check that the code still behaves.

TL;DR

  • vendor/bin/pint —dirty formats the PHP you touched.
  • It does not format Vue.
  • Do not add a PHP fixer inside a Vue file.
  • Do not commit vendor/.

Who it's for: Laravel + Vue developers

Applies to: Laravel 13 · Vue 3

The fix#

shell
vendor/bin/pint --dirty

--dirty limits Pint to git’s dirty files. Commit after you have looked at the diff. Pint rewrites spacing and imports. It does not change a query’s meaning on purpose, but you still read the diff.

Vue, TypeScript, and CSS are not Pint’s job. The kit’s frontend formatter, if you have one, is a different command. Do not add a PHP fixer inside a Vue file.

What to avoid#

Gotcha

Do not commit vendor/. Pint lives there after composer install. CI can run vendor/bin/pint --test so a bad format fails the build without rewriting the branch.

FAQ#

How do I format PHP with Pint before you commit?

vendor/bin/pint --dirty formats the PHP you touched. It does not format Vue.

What goes wrong with Laravel Pint?

Many developers run it with no arguments in a huge repo and then the diff is the whole framework style. Do not add a PHP fixer inside a Vue file.

Found this useful?

Ask questions, share what you built.

Join thousands of Laravel and Vue developers in our Facebook group, or get new posts in your Telegram feed. Sharing this article helps too.

Keep reading

Newsletter

Get the best of Laravel & Vue, once a month.

One short email with new guides, release notes worth reading and hand-picked community links. No spam, unsubscribe any time.