portavice/laravel-pint-config

Laravel Pint configuration used at portavice

Installs: 15 664

Dependents: 7

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/portavice/laravel-pint-config

v2.0.0 2023-11-14 12:15 UTC

This package is auto-updated.

Last update: 2025-10-07 14:05:54 UTC


README

MIT Licensed Latest version on Packagist Total downloads

This project contains the default configuration for Laravel Pint used at portavice GmbH.

The ruleset is based on PSR12 with additional rules for

  • ordered class elements, imports, used interfaces and traits, parameter types,
  • short syntax, proper indentation, trailing commas for arrays,
  • consistent braces, operators, spacing, blank lines,
  • preferring single quotes,
  • and avoiding useless code (else, return, sprintf, empty statements).

Contents

Installation

First, install the package via Composer:

composer require portavice/laravel-pint-config --dev

Note that this automatically installs Laravel Pint as well.

Usage

To simplify usage, you may configure the following scripts in your composer.json:

{
    "scripts": {
        "csPHP": "pint --config vendor/portavice/laravel-pint-config/pint.json --test",
        "csfixPHP": "pint --config vendor/portavice/laravel-pint-config/pint.json"
    }
}

Just run composer csPHP to check and composer csfixPHP to fix the PHP files in your Laravel project. Otherwise, you will have to call the pint command with the --config option.

To use and adjust the set of rules defined by this package, you can also copy the pint.json from this repository into your project.