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
Composer Normalize

Composer Normalize Laravel Package

ergebnis/composer-normalize

Composer plugin to normalize composer.json automatically: consistent key ordering, formatting, and sorting of dependencies. Avoid manual formatting debates and keep projects tidy across teams and CI with a simple dev requirement and allow-plugins setting.

View on GitHub
Deep Wiki
Context7

Provides a composer plugin for normalizing composer.json.

Frequently asked questions about Composer Normalize
How do I install this package for a Laravel project?
Run `composer require --dev ergebnis/composer-normalize` to add it as a dev dependency, then enable the plugin with `composer config allow-plugins.ergebnis/composer-normalize true`. No Laravel-specific setup is needed—it works globally with Composer.
Will this break my Laravel application if I run it?
No, this plugin only normalizes formatting (e.g., key ordering, indentation) and doesn’t alter functionality. It’s safe to run in CI or locally without affecting runtime behavior.
Does this work with Laravel’s monorepo structure or multi-package projects?
Yes, run it in the root directory to normalize all sub-packages’ `composer.json` files. Use the `--file` flag to target specific files, like `composer normalize --file=packages/*/composer.json`.
Can I customize which keys or sections are normalized?
The plugin supports exclusions via configuration. For example, if your Laravel project uses custom `extra.laravel` keys, you can exclude them by setting `normalization.exclude` in your `composer.json` config.
How do I integrate this into GitHub Actions for Laravel?
Add a step to your workflow: `- name: Normalize composer.json run: composer normalize --dry-run`. Fail the job on diffs (exit code 1) to block merges with inconsistent formatting. Works seamlessly with Laravel’s CI pipelines.
Does this support older Laravel/Composer versions (e.g., Composer v1)?
The package officially supports Composer v2+, but you can test it with v1. However, plugins weren’t fully supported in Composer v1, so functionality may be limited. Laravel 5.8+ (Composer v2+) is recommended.
What if my team has custom composer.json formatting (e.g., non-standard keys)?
Use the `--exclude` flag or configure `normalization.exclude` in your `composer.json` to skip specific keys or sections. The plugin defaults to a widely accepted standard but allows customization.
How does this compare to manually formatting composer.json or using php-cs-fixer?
Unlike manual formatting or php-cs-fixer, this plugin enforces *consistent* key ordering and structure across all contributors. It’s faster, repeatable, and integrates directly into Composer’s workflow, reducing noisy diffs in Laravel repos.
Can I run this locally before committing to avoid CI failures?
Yes, use `composer normalize --dry-run` locally to preview changes. Add it to a pre-commit hook (e.g., Husky) to block inconsistent formatting before it reaches CI, saving time for your Laravel team.
What are the performance implications of running this in CI for large Laravel repos?
Normalization is lightweight, but large repos (e.g., Laravel Framework) may add ~10–30 seconds to CI. Cache results or run in parallel. For most Laravel projects, the overhead is negligible compared to the benefits of 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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai