# Format PHP with Pint before you commit

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

- URL: https://laravel-vuejs.space/laravel-pint-before-commit
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs, PHP, Tooling

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](https://laravel-vuejs.space/test-laravel-vue) 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

**Q: How do I format PHP with Pint before you commit?**

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

**Q: 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.
