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

phpyh/coding-standard

Opinionated PHP coding standard for Laravel projects, built on PHP-CS-Fixer with ready-to-use rules, presets, and a simple CLI/workflow to automatically format code and keep style consistent across your team and CI.

Deep Wiki
Context7

phpyh/coding-standard is a reusable PHP coding standard package that helps you keep projects consistent and review-friendly. It bundles opinionated rules and tooling configuration so teams can apply the same formatting and quality checks across repositories with minimal setup.

Use it to standardize style, catch common issues early, and automate enforcement in local development and CI.

  • Provides a curated ruleset for consistent formatting and conventions
  • Integrates with common code sniffing/fixing workflows
  • Easy to install and share across multiple projects
  • Encourages cleaner diffs and smoother code reviews
  • Suitable for automation in CI pipelines
Frequently asked questions about Coding Standard
How do I install **phpyh/coding-standard** in a Laravel project?
Run `composer require --dev phpyh/coding-standard` to install the package. It depends on PHP_CodeSniffer, so ensure it’s installed globally or via Composer (`composer require --dev squizlabs/php_codesniffer`). The package provides a CLI tool (`./vendor/bin/phpcs`) for immediate use.
Does this package support Laravel Blade templates?
Yes, the package includes Blade template support. Configure it in your `phpcs.xml` by adding `<arg name="extensions" value="php,blade"/>` to ensure Blade files are checked alongside PHP. Example: `<config name="installed_paths" value="./vendor/phpyh/coding-standard"/>`.
Will this work with Laravel 10+ and PHP 8.1+?
Yes, **phpyh/coding-standard** is designed for PHP 8.1+ and is compatible with Laravel 10+. The package doesn’t depend on Laravel core, so it integrates seamlessly with modern Laravel projects. Verify your PHP version matches the package’s requirements (`composer show phpyh/coding-standard`).
Can I use this in CI/CD pipelines for Laravel?
Absolutely. Add a step to your CI (e.g., GitHub Actions) like this: `./vendor/bin/phpcs --standard=phpyh --error-severity=5 src/`. Start with `--warning-severity` to avoid blocking builds initially, then escalate to enforce strict compliance. Exclude third-party code with `--ignore=vendor/`.
How do I customize or override the default rules?
Override rules by extending your `phpcs.xml` config. For example, disable a rule with `<rule ref="phpyh.RuleName" severity="0"/>` or add custom rules by creating a `Sniff` class in your project. The package’s rules are opinionated but designed to be flexible for team-specific adjustments.
Does this conflict with Laravel Pint or other formatting tools?
While **phpyh/coding-standard** focuses on static analysis (e.g., PSR-12 compliance), Laravel Pint handles auto-formatting. Use both: Pint for formatting, this package for linting. Avoid duplicate checks by excluding Pint’s rules from your `phpcs.xml` or vice versa. Test both tools together to ensure compatibility.
How do I handle legacy Laravel code that violates the rules?
Start with `--warning-severity` in CI and allow gradual fixes. Use `--ignore` to exclude legacy files temporarily (e.g., `--ignore=old-migrations/`). Document exceptions in `phpcs.xml` with `<exclude-pattern>...</exclude-pattern>`. Prioritize new code for compliance while phasing out legacy violations.
Is this package actively maintained? What’s the last update?
The package was last updated on **2025-10-21**, indicating recent maintenance. Check the repository (if available) for changelogs or GitHub activity. For critical projects, verify compatibility with your Laravel/PHP versions and consider forking if custom rules are needed long-term.
Can I integrate this with PHPStorm or VSCode for real-time feedback?
Yes, install the **PHP_CodeSniffer** plugin in PHPStorm or the **PHP Intelephense** extension in VSCode. Configure the plugin to use `phpyh/coding-standard` as the default standard. This provides real-time underlining of violations and quick fixes, improving developer workflows.
What alternatives exist for Laravel coding standards?
Alternatives include **Laravel Pint** (for auto-formatting), **laravel-shift/blueprint** (Laravel-specific rules), or **PSR-12** via `dealerdirect/phpcodesniffer-composer-installer`. If your team uses **PHPStan** or **Rector**, coordinate to avoid redundant checks. **phpyh/coding-standard** stands out for its curated, reusable ruleset tailored for consistency.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport