PHPackages                             mreduar/laravel-phpcs - 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. mreduar/laravel-phpcs

ActiveLibrary

mreduar/laravel-phpcs
=====================

PHP Codesniffer ruleset to follow Laravel's coding style

1.8.1(3y ago)3817.3k↓20%11MITShellPHP ^7.4|^8.0

Since Jan 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mreduar/laravel-phpcs)[ Packagist](https://packagist.org/packages/mreduar/laravel-phpcs)[ Docs](https://github.com/mreduar/laravel-phpcs)[ RSS](/packages/mreduar-laravel-phpcs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (14)Used By (1)

PHP Codesniffer ruleset to follow Laravel's coding style
========================================================

[](#php-codesniffer-ruleset-to-follow-laravels-coding-style)

[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![PR friendly repository](https://camo.githubusercontent.com/04d9817f9ae2ecc8bd798c1d4874835046ec190e89d2f4b84245e639c38ccbb1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50756c6c2d2d526571756573742d61726525323077656c636f6d65212d666636396234)](/compare)

[php codesniffer](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset) ruleset for laravel or any other php projects.

Installation
------------

[](#installation)

**\[\*\]** Install using composer

```
composer require mreduar/laravel-phpcs --dev
```

**\[\*\]** Install manually

1. Copy the `phpcs.xml` file into your project root.
2. Descoment lines `app` and the others in `phpcs.xml` file.
3. Because this package uses third party standards that are not in phpcs you need to install these package.
    1. `composer require slevomat/coding-standard`
4. Run `phpcs .` to check your project.

Usage
-----

[](#usage)

### Enabling the rules

[](#enabling-the-rules)

> Only neccesary if you installed as a package using composer!

`php artisan vendor:publish --provider="Mreduar\LaravelPhpcs\LaravelPhpcsServiceProvider" --tag="ruleset"`

This will publish to your root directory the following file

```

    ./app
    ./config
    ./resources
    ./routes
    ./tests

```

Optionally you can also publish a git hook that will help you to never overlook smelly code.

`php artisan vendor:publish --provider="Mreduar\LaravelPhpcs\LaravelPhpcsServiceProvider" --tag="hook"`

The file will be published in its root directory `.git/hooks/pre-commit`So every time you try to commit `phpcs` will first check that you have everything correct.

```
$ git commit -m "test"
[1/1] code sniffer        OK!
[master a6133d7] test
 1 file changed, 1 insertion(+), 1 deletion(-)
```

if you have any errors the commit will be cancelled.

### Sniffing code

[](#sniffing-code)

Use php CodeSniffer commands, pointed towards your xml file, to sniff the code using the new ruleset.

`vendor/bin/phpcs``vendor/bin/phpcbf`

#### Sniffing code in PHPStorm

[](#sniffing-code-in-phpstorm)

See [PHP Code Sniffer in PhpStorm](https://confluence.jetbrains.com/display/PhpStorm/PHP+Code+Sniffer+in+PhpStorm) on how to set up CodeSniffer in PHPStorm.

#### Sniffing code Visual Studio Code

[](#sniffing-code-visual-studio-code)

See [PHP Sniffer by wongjn](https://marketplace.visualstudio.com/items?itemName=wongjn.php-sniffer) or other [phpcs](https://marketplace.visualstudio.com/search?term=phpcs&target=VSCode&category=All%20categories&sortBy=Relevance) plugins for more information about PHP Code Sniffer in Visual Studio Code.

---

Contributing
------------

[](#contributing)

All changes that makes the sniffer more accurate towards *Laravel*'s coding standard is always highly appreciated and welcome.

Please see [CONTRIBUTING](CONTRIBUTING.md) for more details.

Credits
-------

[](#credits)

- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~23 days

Recently: every ~35 days

Total

13

Last Release

1293d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b5b586d75cd9a9f79eedadc9259b5202fe3e3eb2a96d8311b51ac6463a6bd3c?d=identicon)[mreduar](/maintainers/mreduar)

---

Top Contributors

[![mreduar](https://avatars.githubusercontent.com/u/22550119?v=4)](https://github.com/mreduar "mreduar (20 commits)")

---

Tags

hacktoberfestlaravellaravel-frameworklaravel-packagephpcsphpcs-laravelphpcs-phpcbfphpcs-standardphpphpcsCoding Standardcoding-stylemreduarlaravel-phpcscoding sniffer

### Embed Badge

![Health badge](/badges/mreduar-laravel-phpcs/health.svg)

```
[![Health](https://phpackages.com/badges/mreduar-laravel-phpcs/health.svg)](https://phpackages.com/packages/mreduar-laravel-phpcs)
```

###  Alternatives

[drupal/coder

Coder is a library to review Drupal code.

3043.6M461](/packages/drupal-coder)[yoast/yoastcs

PHP\_CodeSniffer rules for Yoast projects

221.1M29](/packages/yoast-yoastcs)[orisai/coding-standard

Strict PHP coding standard

19193.5k62](/packages/orisai-coding-standard)

PHPackages © 2026

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