Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Code Style Pint Laravel Package

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.

View on GitHub
Deep Wiki
Context7

title: ArtisanPack UI Code Style Pint

ArtisanPack UI Code Style Pint

Welcome to the ArtisanPack UI Code Style Pint documentation. This package provides a Laravel Pint configuration that enforces the ArtisanPack UI coding standards.

Introduction

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.

Key Features and Benefits

  • Pre-configured Pint Configuration: Ready-to-use pint.json with all ArtisanPack UI rules
  • Artisan Command: Publish configuration with php artisan artisanpack:publish-pint-config
  • Programmatic Configuration: Build custom configurations with the fluent PintConfigBuilder API
  • Rule Group Toggles: Enable/disable formatting, code structure, or best practice rules independently
  • Comprehensive Documentation: Detailed guides for customization, IDE integration, and CI/CD

Technology Stack

  • PHP 8.2+: Built for modern PHP versions
  • Laravel 10/11/12: Compatible with recent Laravel versions
  • Laravel Pint: Uses Laravel's official code style tool
  • PHP-CS-Fixer: Powered by PHP-CS-Fixer under the hood

Getting Started

For Laravel Applications

# 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

For Laravel Packages

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.

Basic Usage Example

use ArtisanPackUI\CodeStylePint\Config\PintConfigBuilder;

// Generate a custom configuration
PintConfigBuilder::create()
    ->withArtisanPackUIPreset()
    ->removeRule('yoda_style')
    ->exclude('app/Legacy')
    ->save(__DIR__ . '/pint.json');

Documentation

Guides

Reference

Integration

Complementary Tools

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"
  }
}

Recommended Workflow

  1. Run Pint to auto-fix formatting issues
  2. Run PHPCS to catch remaining issues (security, naming conventions, etc.)
./vendor/bin/pint
./vendor/bin/phpcs --standard=ArtisanPackUIStandard .

Laravel Boost Integration

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.

Override Default Pint Guidelines

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.

Resources

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
craftcms/url-validator
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony