Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

youssefkorkomaz's avatar

Laravel pint file exclusion

hello all i am using laravel 10 and trying to exclude some files from pint i have created pint.json file with this content:

{ "preset": "laravel", "exclude": [ "routes/web.php" ] }

in my composer.json i have this: "pint": "./vendor/bin/pint", "pint:test": "./vendor/bin/pint --test",

but everythime i run pint using composer pint or ./vendor/bin/pint

the web route is always affected by pint any help please

0 likes
1 reply
Sergiu17's avatar
Sergiu17
Best Answer
Level 60

https://laravel.com/docs/11.x/pint#excluding-files-or-folders

If you would like to exclude a file by providing an exact path to the file, you may do so using the notPath configuration option:
{
    "notPath": [
        "routes/web.php"
    ]
}

so I believe this should do, or

{
    "exclude": [
      "routes"
    ]
}
// this exclude every file from routes folder
1 like

Please or to participate in this conversation.