In Laravel 12, the behavior you're observing with Pint is likely due to changes in the default code style configuration. Pint is a code formatting tool that adheres to a set of predefined rules, and these rules can change between versions to align with evolving best practices or community preferences.
To address your issue, you have a couple of options:
-
Customize Pint Configuration: You can customize the Pint configuration to match your preferred style. Pint uses a
.pint.jsonfile to define its rules. You can create or modify this file in the root of your project to specify your desired formatting rules.Here's an example of how you might configure Pint to adjust the formatting:
{ "preset": "laravel", "rules": { "method_argument_space": { "on_multiline": "ensure_fully_multiline" }, "single_quote": true, "lowercase_keywords": true } }Adjust the rules as needed to achieve the formatting style you prefer.
-
Check for Updates or Changes: Review the release notes or documentation for Laravel 12 and Pint to see if there are any mentions of changes to the default formatting rules. This can provide insight into why the formatting behavior has changed.
-
Revert to Previous Version: If the new formatting style is not acceptable and you prefer the previous behavior, you could consider reverting to the version of Pint used in Laravel 11. However, this is generally not recommended as it may lead to compatibility issues with other tools or libraries.
By customizing the Pint configuration, you can regain control over the formatting style to better suit your preferences.