What is Laravel Pint and How to Use it?

Pint is a Laravel package that fixes coding styles to make the code more readable for developers. It is a package that is included in Laravel 9.x.x and it is built on top of the PHP-CS-Fixer package. It can be used in both fresh Laravel applications and old ones.

It will be beneficial, especially when you have a team because team members will be avoiding using different coding styles.

Install Laravel Pint using Composer

Laravel pint requires PHP version 8, if you install it on a lower PHP version you may get an error in the composer.

  Package laravel/pint has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version

Make sure you are using PHP 8+ and you have the Laravel application installed. To Install Laravel Pint run the following command in the terminal

composer require laravel/pint --dev

After installation, you have two ways that the Laravel Pint package offers. First, you can directly allow the package to make changes in your project, and second, you can ask the package to tell you what changes will be implemented in your project to fix the coding style or to follow the PSR standards.

If you want Pint to fix coding styles without letting you know then run the below command.


In case you want to know which files are modified through Pint then add -v that will add details about files.

./vendor/bin/pint -v

If you just want to know which files have code that can be fixed or doesn’t follow the PSR standard then add –test option. It will tell you which file code needs to be fixed without changing anything in the file.


By default, Laravel does not need any configurations but you can add pint.json in the root directory of the Laravel application to customize the pint actions. In the pint.json you can customize the presets, rules, and targeted folders that need to inspect.


Laravel Pint package helps to clean the code and it fixes the coding styles. In this article, we have learned about installation and usage.