artisanpack-ui/code-style-pint
Laravel Pint preset matching ArtisanPack UI coding standards. Publishes a ready-made pint.json for apps or generates it via builder for packages. Optional WordPress-style spacing support via PHP-CS-Fixer stubs and commands.
Welcome to the ArtisanPack UI Code Style Pint documentation. This package provides a Laravel Pint configuration that enforces the ArtisanPack UI coding standards.
ArtisanPack UI Code Style Pint is a Laravel Pint preset that mirrors the coding standards defined in the artisanpack-ui/code-style PHPCS package. It allows developers to use Laravel Pint (which uses PHP-CS-Fixer under the hood) to automatically format code according to ArtisanPack UI standards.
pint.json with all ArtisanPack UI rulesphp artisan artisanpack:publish-pint-configPintConfigBuilder API# Install the package
composer require artisanpack-ui/code-style-pint --dev
# Publish the configuration
php artisan artisanpack:publish-pint-config
# Run Pint
./vendor/bin/pint
When developing a Laravel package, use the PintConfigBuilder directly since php artisan may not be available:
# Install the package
composer require artisanpack-ui/code-style-pint --dev
Then create a script (e.g., pint-setup.php) in your package root:
<?php
require __DIR__ . '/vendor/autoload.php';
use ArtisanPackUI\CodeStylePint\Config\PintConfigBuilder;
PintConfigBuilder::create()
->withArtisanPackUIPreset()
->save(__DIR__ . '/pint.json');
echo "pint.json created successfully!\n";
Run it with:
php pint-setup.php
./vendor/bin/pint
For detailed instructions, see the Customization Guide.
use ArtisanPackUI\CodeStylePint\Config\PintConfigBuilder;
// Generate a custom configuration
PintConfigBuilder::create()
->withArtisanPackUIPreset()
->removeRule('yoda_style')
->exclude('app/Legacy')
->save(__DIR__ . '/pint.json');
For complete code style enforcement, use this package alongside artisanpack-ui/code-style (PHPCS):
{
"require-dev": {
"artisanpack-ui/code-style": "^1.0",
"artisanpack-ui/code-style-pint": "^1.0"
}
}
./vendor/bin/pint
./vendor/bin/phpcs --standard=ArtisanPackUIStandard .
This package includes AI guidelines for Laravel Boost. When users run php artisan boost:install, the ArtisanPack UI Pint guidelines are automatically available to AI assistants.
To replace Laravel's default Pint guidelines with ArtisanPack UI standards:
php artisan vendor:publish --tag=artisanpack-boost-override
This creates .ai/guidelines/laravel/pint.blade.php, ensuring AI assistants follow ArtisanPack UI standards when generating or formatting code.
How can I help you explore Laravel packages today?