- How do I install this Pint preset for Laravel?
- Run `composer require artisanpack-ui/code-style-pint --dev` to install the package. Then publish the preset with `php artisan artisanpack:publish-pint-config` or use `php artisan vendor:publish --tag=artisanpack-pint-config`.
- Does this package support Laravel 13?
- Yes, this package explicitly supports Laravel 13 via its widened `illuminate/support` constraint (^10.0|^11.0|^12.0|^13.0). It’s designed to work seamlessly with the latest Laravel version while maintaining backward compatibility.
- Can I use this preset for Laravel packages instead of applications?
- Absolutely. Use the `PintConfigBuilder` class directly in your package’s setup script. Run `php pint-setup.php` (where the script includes the builder) to generate a `pint.json` file tailored for packages.
- What coding standards does this preset enforce?
- This preset aligns with the `artisanpack-ui/code-style` PHPCS package, enforcing rules like array syntax (short/long), spacing, brace positioning, import ordering, and strict type declarations. It also supports WordPress-style spacing via PHP-CS-Fixer.
- How do I enable WordPress-style spacing (e.g., spaces inside brackets) in my Laravel app?
- Run `php artisan artisanpack:publish-pint-config --wordpress` to generate a `.php-cs-fixer.dist.php` file. Install PHP-CS-Fixer with `composer require --dev friendsofphp/php-cs-fixer`, then run `./vendor/bin/php-cs-fixer fix` to apply the rules.
- Will this break existing Pint configurations in my project?
- No, the package includes a `--force` flag for the publish command to overwrite existing `pint.json`. Otherwise, it will merge configurations if possible. Always back up your current `pint.json` before publishing.
- Does this package work with PHP 8.1+ only, or does it support older PHP versions?
- This package requires PHP 8.1+ due to Laravel Pint’s dependencies. If you’re using an older PHP version, consider alternatives like PHP-CS-Fixer alone or upgrading your PHP environment.
- Are there any known conflicts with Laravel’s built-in Pint rules?
- No major conflicts are documented, but Laravel 13’s new features (e.g., PHP 8.3+ syntax or updated `illuminate/support` methods) might interact unpredictably. Test with `pint --test` on a Laravel 13 skeleton project if concerned.
- Can I customize the preset instead of using the default rules?
- The preset is designed to be opinionated for consistency, but you can manually edit the published `pint.json` or extend the `PintConfigBuilder` in your package’s setup script to override specific rules.
- What alternatives exist if I don’t want to use this preset?
- For Laravel, you can use the default Pint preset (`laravel/pint`) or configure PHP-CS-Fixer manually. For WordPress-style spacing, PHP-CS-Fixer alone is a viable alternative, though it lacks the ArtisanPack UI-specific rules.