PHPackages                             kevyworks/laravel-php-cs-fixer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. kevyworks/laravel-php-cs-fixer

ActiveLibrary

kevyworks/laravel-php-cs-fixer
==============================

A PHP-CS-Fixer bridge for use via Artisan CLI on Laravel 5.5+

2.0.2(6y ago)05MITPHPPHP &gt;=5.6.4

Since May 14Pushed 6y agoCompare

[ Source](https://github.com/kevyworks/laravel-php-cs-fixer)[ Packagist](https://packagist.org/packages/kevyworks/laravel-php-cs-fixer)[ RSS](/packages/kevyworks-laravel-php-cs-fixer/feed)WikiDiscussions dev Synced 1mo ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

PHP CS Fixer for Laravel 5.5+
=============================

[](#php-cs-fixer-for-laravel-55)

[![Total Downloads](https://camo.githubusercontent.com/2317419d79b839d378c5ef247ae4e09eacbd3df1f6a6d5cb74a0401e5bf1f342/68747470733a2f2f706f7365722e707567782e6f72672f6267617a652f6c61726176656c2d7068702d63732d66697865722f646f776e6c6f616473)](https://packagist.org/packages/bgaze/laravel-php-cs-fixer)[![Latest Stable Version](https://camo.githubusercontent.com/abd7d8aee4bf5df272c0a05c22cf177403e9c693dc638a93af5f35dfe0b1483e/68747470733a2f2f706f7365722e707567782e6f72672f6267617a652f6c61726176656c2d7068702d63732d66697865722f762f737461626c65)](https://packagist.org/packages/bgaze/laravel-php-cs-fixer)[![Latest Unstable Version](https://camo.githubusercontent.com/92bf70b2043a68b1e01c10b8cbfc0c16389d4472886afbd973d1ce3e26cd1ac3/68747470733a2f2f706f7365722e707567782e6f72672f6267617a652f6c61726176656c2d7068702d63732d66697865722f762f756e737461626c65)](https://packagist.org/packages/bgaze/laravel-php-cs-fixer)[![License](https://camo.githubusercontent.com/bb87488fb592bbf32abb0f6c548c32df355a8b866c3bd0d3c94af0d1e26fe2ec/68747470733a2f2f706f7365722e707567782e6f72672f6267617a652f6c61726176656c2d7068702d63732d66697865722f6c6963656e7365)](https://packagist.org/packages/bgaze/laravel-php-cs-fixer)

This package allows to use [PHP-CS-Fixer](https://cs.sensiolabs.org/) right into Laravel 5.5+ applications to format PHP code following PSR-1 and PSR-2 coding standards.

> **Important:**
> Default PHP-CS-Fixer config was updated in v2 to remove dependency to `@Symfony` ruleset and be more compliant with Laravel coding style.
> If needed, you'll find v1 config [here](https://github.com/bgaze/laravel-php-cs-fixer/blob/1.0.2/src/config/.php-cs).

Credits
=======

[](#credits)

Forked from [bgaze/laravel-php-cs-fixer](https://github.com/bgaze/laravel-php-cs-fixer)

This package is an adapted copy of .
Credits and many thanks to [JackieDo](https://github.com/JackieDo) :-)

Provided features
=================

[](#provided-features)

- A PHP-CS-Fixer installation right into Laravel 5.5+ projects.
- Commands to execute PHP-CS-Fixer via Laravel Artisan CLI :
    - **php-cs-fixer:fix :** Fix php coding standards for directories or files.
    - **php-cs-fixer:describe :** Describe rule / ruleset of fixer.
    - **php-cs-fixer:version :** Display PHP-CS-Fixer version.
- An helper to fix files from the code : **php\_cs\_fixer**.

Installation
============

[](#installation)

Install this package using [Composer](https://getcomposer.org).

`$ composer require bgaze/laravel-php-cs-fixer`

To customize the configuration, publish it :

`$ php artisan vendor:publish --tag=bgaze-php-cs-fixer-config`

> **Note :**
> Configuration isn't a standard Laravel config files as it returns an instance of `\PhpCsFixer\Config`.
> It will be published into a `.php-cs` file at the Laravel installation root.

Usage
=====

[](#usage)

Please see [PHP-CS-Fixer documentation](https://cs.sensiolabs.org/#usage) for more details.

Fix
---

[](#fix)

Fix your code with PHP Coding Standards.

### From Artisan CLI

[](#from-artisan-cli)

Usage:

`$ php artisan php-cs-fixer:fix [options] [path/to/dir/or/file]`

Syntax:

Usage:

`$ php-cs-fixer:fix [options] path1 [path2 path3 ...]`

Arguments:

`path                             Path to directory or file (multiple values allowed).`

Options:

```
--allow-risky                    Allow risky fixers.
--dry-run                        Only shows which files would have been modified, leaving your files unchanged.
--stop-on-violation              Stop execution on first violation.
--diff                           Also produce diff for each file.
--using-cache                    Enable cache usage.
--path-mode[=PATH-MODE]          Specify path mode (override|intersection). [default: "override"]
--config[=CONFIG]                The path to a .php-cs-fixer file.
--rules[=RULES]                  The rules to apply for fixer (comma separated).
--cache-file[=CACHE-FILE]        The path to the cache file.
--format[=FORMAT]                To output results in other formats.
--show-progress[=SHOW-PROGRESS]  Type of progress indicator (none|run-in|estimating). [default: "none"]
-h, --help                       Display this help message
-q, --quiet                      Do not output any message
-V, --version                    Display this application version
--ansi                           Force ANSI output
--no-ansi                        Disable ANSI output
-n, --no-interaction             Do not ask any interactive question
    --env[=ENV]                  The environment the command should run under
-v|vv|vvv, --verbose             Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

```

Default config files `.php_cs.dist` and `.php_cs`

Examples:

```
// Only shows which all files in your project would have been modified, leaving your files unchanged.
$ php artisan php-cs-fixer:fix --dry-run

// Really fixes all files in your project.
$ php artisan php-cs-fixer:fix

// Only fixes all files in the `app` directory.
$ php artisan php-cs-fixer:fix app

// Only fixes all files in the `app` directory with specific configuration file.
$ php artisan php-cs-fixer:fix --config="path/to/config/file" app

```

### From PHP code

[](#from-php-code)

The **php\_cs\_fixer()** helper wraps **php-cs-fixer:fix** command and allows to fix files right from the code.
It returns the exit code of the command.

Usage :

```
// $path : a path or an array of paths.
// $options : an array of options.
php_cs_fixer($path, $options);
```

Examples :

```
// Quick.
php_cs_fixer('path/to/a/file/or/dir');

// Advanced.
php_cs_fixer(['path/to/file/or/dir/1', 'path/to/file/or/dir/2'], [
    '--allow-risky' => true,
    '--dry-run' => true,
    '--config' => 'path/to/a/config/file'
]);
```

Describe rule or set
--------------------

[](#describe-rule-or-set)

Usage:

`$ php-cs-fixer:describe name`

Arguments:

`name                  Name of rule / set.`

Options:

```
-h, --help            Display this help message
-q, --quiet           Do not output any message
-V, --version         Display this application version
--ansi                Force ANSI output
--no-ansi             Disable ANSI output
-n, --no-interaction  Do not ask any interactive question
--env[=ENV]           The environment the command should run under
-v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

```

Version
-------

[](#version)

Displays PHP-CS-Fixer version installed.

Usage:

`$ php artisan php-cs-fixer:version`

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 93.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~133 days

Recently: every ~162 days

Total

6

Last Release

2255d ago

Major Versions

1.0.2 → 2.0.02020-02-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b639de4321ddf9ff8f5d95d4e63f36699f65b82a7257cc7b197624d8b319768?d=identicon)[kevyworks](/maintainers/kevyworks)

---

Top Contributors

[![bgaze](https://avatars.githubusercontent.com/u/985214?v=4)](https://github.com/bgaze "bgaze (41 commits)")[![fridzema](https://avatars.githubusercontent.com/u/8180660?v=4)](https://github.com/fridzema "fridzema (3 commits)")

### Embed Badge

![Health badge](/badges/kevyworks-laravel-php-cs-fixer/health.svg)

```
[![Health](https://phpackages.com/badges/kevyworks-laravel-php-cs-fixer/health.svg)](https://phpackages.com/packages/kevyworks-laravel-php-cs-fixer)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
