cweagans/composer-patches
Apply and manage patch files to Composer dependencies. Lets you keep fixes and tweaks outside vendor/ while still using normal Composer updates, with support for multiple patches per package, remote patch URLs, descriptions, and CI-friendly installs.
{{< lead text="Common workflows for working with Composer Patches on a team." >}}
The plugin can safely be [installed]({{< relref "../getting-started/installation.md" >}}) as part of initial project setup, even if you don't have any patches to apply right away. A patches.lock.json will still be written, but it will be empty.
composer.json or your external patches file (either will work by default, but choose the appropriate place based on how your project is configured).composer patches-relock]({{< relref "commands.md#composer-patches-relock" >}}) to regenerate patches.lock.json with your new patch.composer patches-repatch]({{< relref "commands.md#composer-patches-repatch" >}}) to delete patched dependencies and reinstall them with any defined patches {{< warning title="Running composer patches-repatch will delete data" >}}
Ensure that you don't have any unsaved changes in any patched dependencies in your project.
{{< /warning >}}composer.json, run composer update --lock to update the content hash in composer.lock.composer.json, composer.lock, and patches.lock.json.If you have an existing copy of the project and you're updating it to include someone else's changes:
composer patches-repatch]({{< relref "commands.md#composer-patches-repatch" >}}) {{< warning title="Running composer patches-repatch will delete data" >}}
Ensure that you don't have any unsaved changes in any patched dependencies in your project.
{{< /warning >}}If you're installing the project from scratch:
composer installcomposer.json or external patches file.composer patches-relock]({{< relref "commands.md#composer-patches-relock" >}}) to regenerate patches.lock.json with your new patch.vendor/ directory).composer patches-repatch]({{< relref "commands.md#composer-patches-repatch" >}}) to delete patched dependencies and reinstall them with any defined patches {{< warning title="Running composer patches-repatch will delete data" >}}
Ensure that you don't have any unsaved changes in any patched dependencies in your project.
{{< /warning >}}composer.json, run composer update --lock to update the content hash in composer.lock.composer.json, composer.lock, and patches.lock.json.How can I help you explore Laravel packages today?