# Apply a patch to a drupal module using composer.
## Apply patch
1. In `composer.json` add the new object to `extra.patches`.
2. Run `composer install`
3. If everything went well then you need to tell the `composer.lock` file to update itself with the new patch.
4. Run `composer update --lock` if so.
## Remove patch
1. Remove the patch from `extra.patches`.
2. Run `composer install`
3. Update `composer.lock` by runing `composer update --lock`.
4.
## JSON documentation
```json
{
"extra": {
"patches": {
"path/to/module": {
"Description": "https://link.com/to/patch"
}
},
}
}
```
**path/to/module** - Same as it is in the `require` object.
**Description** - Title of issue thread.
**https://link.com/to/patch** - Link to patch file from issue thread.