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
Coding Standard

Coding Standard Laravel Package

binsoul/coding-standard

PHP_CodeSniffer-based coding standard bundle for PHP projects, providing opinionated style rules and configurations to keep code consistent. Easy to install via Composer and integrate into CI for automated code style checks and enforcement.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Coding Standard
How do I install binsoul/coding-standard for Laravel projects?
Run `composer require binsoul/coding-standard --dev` in your Laravel project. The package installs as a dev dependency, ensuring it’s excluded from production builds. It provides a preconfigured PHP_CodeSniffer standard for immediate use.
Does this package support Laravel’s Blade templates (.blade.php files)?
By default, PHP_CodeSniffer ignores Blade files, but you can explicitly include them in the ruleset by modifying the `phpcs.xml` configuration. Add `<file>*.blade.php</file>` under the `<arg>` section to enforce standards on Blade templates.
Can I customize the coding standard rules to match Laravel-specific conventions?
Yes, the package allows customization via `phpcs.xml`. Override default rules by extending the configuration, such as allowing Laravel-specific docblock formats or adjusting naming conventions for controllers, services, or Facades.
How do I integrate this into Laravel’s CI/CD pipeline (e.g., GitHub Actions)?
Add a step to your CI workflow to run `./vendor/bin/phpcs --standard=Binsoul --error-severity=1 .`. For GitHub Actions, use the `error-severity` flag to fail builds on violations. Pair it with `symplify/easy-coding-standard` for richer reporting.
Will this package conflict with other Laravel tools like laravel-pint or PHPStan?
No direct conflicts exist, but ensure consistent tooling. Use `laravel-pint` for auto-formatting and `binsoul/coding-standard` for static analysis. PHPStan’s rules are separate, so run them independently or combine outputs in CI.
Does binsoul/coding-standard work with Laravel Forge or Envoyer for deployment checks?
The package itself doesn’t integrate natively with Forge/Envoyer, but you can manually run `phpcs` as a deployment hook. Add a script to your `deploy.php` (Envoyer) or Forge recipe to execute the standard before deployment.
How do I handle false positives, like Laravel’s Route::resource() helpers or Facade usage?
Override conflicting rules in `phpcs.xml` by excluding specific patterns. For example, ignore Facade method calls with `<exclude-pattern>.*Facade::.*</exclude-pattern>` or adjust severity for Laravel-specific constructs.
What Laravel versions and PHP versions does this package support?
The package doesn’t enforce Laravel version constraints, so it works with any Laravel 5.8+ project. Ensure your PHP version (e.g., 8.0+) matches Laravel’s requirements and PHP_CodeSniffer’s compatibility.
Can I use this package with GrumPHP for pre-commit hooks?
Yes, the package includes GrumPHP configuration. Add `phpro/grumphp-shim` and reference the package’s `grumphp.yaml` in your `composer.json` under `extra.grumphp`. Configure hooks to run `phpcs` on staged files.
What alternatives exist for Laravel coding standards, and why choose this package?
Alternatives include `php-cs-fixer` (for auto-fixing) or `dealerdirect/phpcodesniffer-composer-installer` (for custom standards). This package offers a preconfigured, opinionated standard tailored for Laravel, reducing setup time while maintaining flexibility.
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky