1 August 2022

Running Laravel Pint in PhpStorm

To get Laravel Pint to automatically reformat your PHP code on save in PhpStorm, configure it as a file watcher to run as an "action on save".

  1. Turn off PhpStorm's built-in code formatting for PHP.

Laravel Pint PhpStorm 1

  1. Create a new File Watcher for Laravel Pint:

Laravel Pint PhpStorm 2

  1. Use the following file watcher settings:

Laravel Pint PhpStorm 3

  • Program: $ProjectFileDir$/vendor/bin/pint
  • Arguments: $FileRelativePath$
  • Output paths to refresh: $FileRelativePath$
  • Working directory: $ProjectFileDir$

Looking for more?

Subscribe to my newsletter to get infrequent updates in your inbox. Or follow me on Twitter.