Weave 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

Code Style Laravel Package

artisanpack-ui/code-style

A custom PHP_CodeSniffer standard for ArtisanPack UI projects, with 16+ sniffs enforcing consistent formatting, naming, security, and best practices. Install via Composer, add a phpcs.xml ruleset, and run phpcs to check your code.

View on GitHub
Deep Wiki
Context7

A custom PHP code style standard based on PHPStorm settings. This package provides custom sniffs for PHP_CodeSniffer that enforce consistent code style across your PHP projects.

Frequently asked questions about Code Style
What is artisanpack-ui/code-style and what does it actually do?
It is a custom PHP_CodeSniffer standard called ArtisanPackUIStandard that bundles 16+ sniffs covering formatting, code structure, naming conventions, security, and best practices. It ships no runtime code, no service provider, and no migrations, so it only affects your project when phpcs runs. Install it as a dev dependency to enforce a consistent style across a Laravel codebase.
How do I install artisanpack-ui/code-style in a Laravel project?
Run composer require artisanpack-ui/code-style --dev. Then create a phpcs.xml in your project root that references ArtisanPackUIStandard and lists the paths to check, such as app, src, and tests. Finally run ./vendor/bin/phpcs from the project root. It works with any Composer project on PHP 8.2+, including Laravel applications.
How do I configure phpcs.xml for the ArtisanPackUIStandard ruleset?
Add a ruleset element that references ArtisanPackUIStandard, file entries for the directories you want scanned, and exclude-pattern entries for vendor and node_modules. Once phpcs.xml exists, running ./vendor/bin/phpcs picks it up automatically without a --standard flag. You can also pass --standard=ArtisanPackUIStandard explicitly on the command line.
Does this package support Laravel Blade templates?
Yes, and this is one of its stronger differentiators versus PHP-CS-Fixer or Laravel Pint. A dedicated Blade ControlStructures sniff enforces alternative syntax such as if/endif and foreach/endforeach inside templates while requiring braces in plain PHP files, and a PhpTags rule flags raw PHP tags in Blade. PHP_CodeSniffer tokenises PHP embedded in Blade far more gracefully than generic formatters do.
Will artisanpack-ui/code-style conflict with Laravel Pint or PSR-12?
It can. The standard intentionally diverges from PSR-12 and Laravel conventions in several places, including spaces inside parentheses, tabs for indentation, Yoda conditionals, uppercase magic methods, and mandatory type declarations. Running it alongside Pint will produce contradictory fixes, so pick one as your source of truth. You can override or exclude individual sniffs in phpcs.xml if you only want part of the ruleset.
How do I customize or disable individual sniffs?
Override sniff properties directly in phpcs.xml, for example setting the indent property on ArtisanPackUI.Formatting.Indentation to 2. To drop a rule entirely, add an exclude element naming the sniff inside the ruleset. This lets you adopt the standard incrementally by excluding sniffs you cannot afford to retrofit and ratcheting them on later.
Can I adopt this on an existing Laravel codebase with thousands of violations?
Yes, but plan for remediation volume. Introducing any new standard surfaces findings dominated by the Indentation and Spacing sniffs, and PHPCS 3.x has no first-class baseline mechanism for pre-existing violations. The practical approach is a committed phpcs.xml that excludes the costliest sniffs first, then re-enables them directory by directory. PHPCS 4.x adds baseline support, but its maturity is still unproven.
Why does the TypeDeclaration sniff complain about my Eloquent models?
The standard requires type declarations on functions and properties, but the TypeDeclaration sniff carves out an exception for Laravel models because property types break Eloquent's magic attribute handling. If you hit related false positives on facades, macros, form requests, or closures in config files, add targeted exclusions in phpcs.xml. Expect to need a few more carve-outs as you roll the standard out.
How do I run artisanpack-ui/code-style in CI or a pre-commit hook?
Add ./vendor/bin/phpcs to your pipeline; GitHub Actions, GitLab CI, and Husky or GrumPHP pre-commit hooks all work the same way. Because the package ships no runtime code, blast radius is limited to CI and developer machines. Value depends entirely on enforcement, so the standard only pays back if phpcs runs automatically and the team acts on its output.
Is artisanpack-ui/code-style safe to add to a production Laravel app?
Yes. It is a dev-only Composer dependency that registers a PHP_CodeSniffer standard, so it adds no service providers, migrations, or runtime code, and removing it is a one-line Composer change. The real consideration is process, not runtime risk: adopting it means accepting the author's formatting opinions as your team's default. Check the repository for recent releases before making it your house standard.
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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource