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

Composer Patches Plugin Laravel Package

netresearch/composer-patches-plugin

Composer plugin that automatically applies patches to your dependencies after install and update. Define local or remote diff files in composer.json to keep third-party packages fixed without forking. Helps make dependency patching reproducible and easy to manage across environments.

Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is not a Laravel package in the application-runtime sense — it is a Composer plugin that hooks into the dependency-resolution/install lifecycle to apply patch files against third-party packages under vendor/. Architecturally it sits at the build/tooling layer, entirely outside the Laravel request lifecycle. That is actually a favorable placement: it does not couple to the framework, does not touch autoloading semantics, and is confined to composer install/update. For a Laravel codebase it is a dev-time dependency, not a runtime one.

Integration feasibility. Mechanically trivial: composer require --dev netresearch/composer-patches-plugin, declare patches in composer.json extra, and grant the plugin permission via config.allow-plugins (Composer 2.2+ requires explicit consent). No application code changes, no service provider, no config publishing. The real friction is governance, not engineering.

Technical risk. This is where the package warrants scrutiny:

  • License: AGPL-3.0. This is the dominant risk. AGPL is a strong copyleft license, and its network-use clause is poorly understood for build tooling. Most legal teams treat dev-only tooling as non-distributed and therefore tolerable, but that position is not free — it requires a legal review and a documented decision. Many enterprises ban AGPL outright regardless of deployment scope. This alone can block adoption.
  • Low adoption signal. ~80 stars against a well-established incumbent (cweagans/composer-patches, thousands of stars, years of production use) means this is a niche alternative. There is no meaningful ecosystem gravity.
  • Repository metadata is incomplete ("unknown"), and the listed last release (2026-10-08) is anomalous relative to the current date. That is a data-quality flag — treat release cadence and provenance claims as unverified until confirmed against Packagist and the actual repo.
  • Overlap with the incumbent means we would be choosing a less-proven tool to do a job the community has already standardized on.

Key questions to resolve before commitment.

  1. Why this plugin over cweagans/composer-patches? Is there a specific capability gap (patch ordering, conflict handling, local vs. remote patch sources, exit-code behavior) that justifies the switch?
  2. Has Legal signed off on AGPL-3.0 for dev-only tooling, and is that decision durable across future distribution scenarios (e.g., shipping source to a client)?
  3. Who maintains it, what is the bus factor, and what is the actual release history on Packagist (the "unknown repo" metadata undermines confidence)?
  4. Which Composer and PHP versions are supported, and is that matrix compatible with our Laravel/PHP baseline?
  5. Does the patch-definition format differ from the incumbent's, and what is the migration cost per repository?

Integration Approach

Stack fit. Language- and framework-agnostic. Any Composer-managed PHP project — Laravel included — is a valid target. Nothing about Laravel's structure (service container, package discovery, artisan) interacts with it, which is good: blast radius is limited to dependency installation.

Migration path. If we are currently on cweagans/composer-patches, the migration is: (a) remove the incumbent, (b) add this plugin, (c) translate the extra.patches block, (d) re-resolve and reinstall. The critical unknown is format parity — both use an extra patches map keyed by package name, but the value shapes (single URL vs. list, local path handling, descriptive keys) may differ. Plan an explicit format-diff spike on one representative repo before committing to a repo-wide migration. If we are greenfield, adoption is simply "add plugin, add patches."

Compatibility. Verify three things concretely: Composer major version support (Composer 2.x is the floor; Composer 3 readiness is a forward-looking concern), the supported PHP matrix against our Laravel baseline, and allow-plugins configuration. The last is an operational trap — in non-interactive CI, an ungranted plugin is silently skipped or the install aborts, depending on Composer version and flags. Pin the allow-list in composer.json and commit it.

Sequencing. Do not roll out fleet-wide.

  1. Spike (1 repo, 1–2 days): install, port two or three real patches, confirm apply-on-install and fail-on-conflict behavior.
  2. Legal gate: obtain written AGPL disposition for dev-tooling use before any wider adoption.
  3. Pilot (3–5 repos): include at least one with a heavy patch set and one with CI caching, to surface reproducibility issues.
  4. Standardize: document the extra.patches convention, the allow-plugins entry, and the "patch broke after dependency bump" runbook.
  5. Fleet rollout only if the pilot shows deterministic behavior and no legal objection.

Operational Impact

Maintenance. This is the sharpest concern. A single-maintainer, ~80-star Composer plugin is a thin maintenance surface. If the maintainer walks away, we own the fork or we migrate back to the incumbent — either is a non-trivial, unscheduled cost. Budget for the possibility that this becomes our code to maintain. The AGPL license also means a fork inherits copyleft obligations, constraining how we could redistribute a patched fork.

Support. Community-only. No vendor SLA, no commercial backing, no guaranteed response on issues. Escalation path is "read the source" — which is feasible for a plugin this small, but only if we have a PHP-fluent engineer available. This is acceptable for dev tooling; it would not be for anything in the request path.

Scaling. Patches are applied at install time, so cost scales with the number of patched packages and CI job count. Practical scaling considerations:

  • Reproducibility: patch sources must be pinned (SHAs, not branches) or builds drift.
  • CI caching: patched vendor trees interact awkwardly with Composer cache layers; validate cache keys include patch file hashes, or you will ship stale code.
  • Patch-count ceiling: a large patch set is an accumulating liability — every upstream dependency bump is a potential silent break. Track patched packages as technical debt with an owner and a review cadence.

Failure modes. Ranked by likelihood and severity:

  1. Patch fails to apply after a dependency update — install aborts, CI red, developer blocked. Highest frequency; needs a runbook and a policy for "patch is stale, upstream has merged."
  2. Patch applied but semantically wrong — context shifts by a line or two, patch applies with fuzz, behavior subtly diverges. Worst severity because it's silent.
  3. Plugin silently not loaded — allow-plugins misconfigured, patch never applied, team believes it is. Detected only when the bug the patch fixes reappears.
  4. Patch sources unavailable — remote URL for a patch file goes 404, builds break unexpectedly. Mitigate by vendoring patch files in-repo.
  5. Composer version incompatibility — post-upgrade breakage; pin Composer in CI.

Ramp-up. Low for anyone who has used any Composer patch mechanism — the mental model transfers directly. The real ramp-up cost is not tooling knowledge but policy: teams need to learn when patching is acceptable, how to document why a patch exists, and how to retire it. That governance overhead is identical to the incumbent's and should be written down once, centrally.

Bottom line. Technically low-risk to integrate, operationally thin, and legally the most consequential decision in this evaluation. The AGPL-3.0 license plus a weak adoption signal (80 stars, unknown repo, anomalous release date) means the default recommendation is to stay on the established incumbent unless a specific capability gap is demonstrated. If a gap exists, adopt on a pilot basis only after Legal signs off, pin all patch sources, and treat the plugin as a potential fork candidate from day one.

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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums