rappasoft / laravel-patches
Run patches migration style in your Laravel applications.
Fund package maintenance!
Requires
- php: ^8.2
- illuminate/contracts: ^11.0|^12.0|^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.0|^4.0|^5.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0|^5.0
- phpunit/phpunit: ^11.5|^12.0|^13.0
- spatie/laravel-ray: ^1.37
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-09 19:15:36 UTC
README
Enjoying this package? Buy me a beer 🍺
This package generates patch files in the same fashion Laravel generates migrations. Each file is timestamped with an up and a down method and is associated with a batch. You may run or rollback patches with the commands below.
The package runs each patch's up and down methods in order, tracks execution metadata, and dispatches lifecycle events. Errors are logged, and database transactions can be enabled globally or per patch. Test patches and keep a backup plan when running them in production.
Requirements
- PHP 8.2+
- Laravel 11.x - 13.x (Laravel 13 requires PHP 8.3+)
Use patched Laravel 12.69+ or 13.30+ for production. Laravel 11 remains compatible, but its security support ended on March 12, 2026 and it has unresolved framework advisories.
Installation
You can install the package via composer:
composer require rappasoft/laravel-patches
Publish and run the migrations:
php artisan vendor:publish --provider="Rappasoft\LaravelPatches\LaravelPatchesServiceProvider" --tag="laravel-patches-migrations" php artisan migrate
Documentation and Usage Instructions
See the documentation for detailed installation and usage instructions.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.