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.
composer require --dev cweagans/composer-patchescomposer.json under the "extra" section:
{
"extra": {
"patches": {
"drupal/core": {
"Fix missing method": "patches/core-missing-method.patch"
}
}
}
}
patches/), and run composer install or composer update—patches will apply automatically during dependency resolution.patches.json for large patch sets or multi-environment consistency (reference via "patches-file": "patches.json" in extra).patches/ is committed or generated early in the build.replace blocks (e.g., patch symfony/http-foundation only when not using symfony/framework-bundle v6+).git archives for version-controlled, auditable patch files.composer install, update, and require—but only if the package version changes or the patch metadata changes; use --with-all-dependencies to force reapplication if needed."patches/fix-foo.patch" works regardless of target package).composer --verbose install and inspect logs for Skipped (already applied) or Could not apply messages.POST_PATCH_APPLY (newer versions) or manually patch via script triggers if dynamic patching is needed.composer dump-autoload is run.How can I help you explore Laravel packages today?