Skip to content

Commit c500994

Browse files
committed
v4
1 parent deed7fc commit c500994

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+5017
-284
lines changed

.github/workflows/run-tests.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,26 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.1]
17-
laravel: [10.*]
16+
php: [8.2, 8.3]
17+
laravel: [11.*, 12.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
20-
- laravel: 10.*
21-
testbench: 8.0
20+
- laravel: 11.*
21+
testbench: ^9.0
22+
- laravel: 12.*
23+
testbench: ^9.0
2224

23-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
25+
name: PHP${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2426

2527
steps:
2628
- name: Checkout code
27-
uses: actions/checkout@v2
29+
uses: actions/checkout@v4
2830

2931
- name: Setup PHP
3032
uses: shivammathur/setup-php@v2
3133
with:
3234
php-version: ${{ matrix.php }}
33-
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
35+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo
3436
coverage: none
3537

3638
- name: Setup problem matchers
@@ -44,4 +46,4 @@ jobs:
4446
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4547
4648
- name: Execute tests
47-
run: vendor/bin/phpunit
49+
run: vendor/bin/phpunit --testdox

CHANGELOG.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,37 @@
22

33
All notable changes to `laravel-patches` will be documented in this file.
44

5-
## 3.0.0 - 2023-04-03
5+
## 4.0.0 - 2025-12-05
66

77
### Added
8+
- Laravel 11 & 12 support
9+
- PHP 8.2+ support
10+
- Comprehensive test suite with Pest PHP
11+
- Repository tests (11 test cases)
12+
- Patcher tests (12 test cases)
13+
- Patch base class tests (6 test cases)
14+
- Model tests (9 test cases)
15+
- Integration tests (7 test cases)
16+
- Enhanced command tests with additional coverage
17+
18+
### Changed
19+
- **BREAKING**: Minimum PHP version is now 8.2
20+
- **BREAKING**: Minimum Laravel version is now 11.0 (supports 11.x - 12.x)
21+
- Updated all dependencies for Laravel 11 compatibility
22+
- Migrated from PHPUnit to Pest for testing
23+
- Updated Model to use modern Laravel 11 conventions
24+
- Removed deprecated `$dates` property from Model
25+
- Updated `$casts` to include datetime casting for `ran_on`
26+
- Changed from `$fillable` to `$guarded = []` for mass assignment
27+
- Updated README with requirements section
28+
29+
### Fixed
30+
- Fixed deprecated Model property usage for Laravel 11
31+
- Model now properly casts `ran_on` as datetime
832

33+
## 3.0.0 - 2023-04-03
34+
35+
### Added
936
- Laravel 10 Support
1037

1138
## 2.0.1 - 2022-02-26

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ This package generates patch files in the same fashion Laravel generates migrati
99

1010
This is a very simple package. It runs whatever is in your up and down methods on each patch in the order the patches are defined. It currently does not handle any errors or database transactions, please make sure you account for everything and have a backup plan when running patches in production.
1111

12+
## Requirements
13+
14+
- PHP 8.2+
15+
- Laravel 11.x - 12.x
16+
1217
## Installation
1318

1419
You can install the package via composer:
@@ -17,6 +22,13 @@ You can install the package via composer:
1722
composer require rappasoft/laravel-patches
1823
```
1924

25+
Publish and run the migrations:
26+
27+
```bash
28+
php artisan vendor:publish --provider="Rappasoft\LaravelPatches\LaravelPatchesServiceProvider" --tag="laravel-patches-migrations"
29+
php artisan migrate
30+
```
31+
2032
## Documentation and Usage Instructions
2133

2234
See the [documentation](https://rappasoft.com/docs/laravel-patches) for detailed installation and usage instructions.

composer.json

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,17 @@
1515
}
1616
],
1717
"require": {
18-
"php": "^8.0",
19-
"spatie/laravel-package-tools": "^1.1",
20-
"illuminate/contracts": "^10.0"
18+
"php": "^8.2",
19+
"spatie/laravel-package-tools": "^1.16",
20+
"illuminate/contracts": "^11.0|^12.0"
2121
},
2222
"require-dev": {
23-
"friendsofphp/php-cs-fixer": "^3.1",
24-
"orchestra/testbench": "^8.0",
25-
"phpunit/phpunit": "^10.1",
26-
"spatie/laravel-ray": "^1.9"
23+
"friendsofphp/php-cs-fixer": "^3.64",
24+
"orchestra/testbench": "^9.0",
25+
"pestphp/pest": "^2.0",
26+
"pestphp/pest-plugin-laravel": "^2.0",
27+
"phpunit/phpunit": "^10.0",
28+
"spatie/laravel-ray": "^1.37"
2729
},
2830
"autoload": {
2931
"psr-4": {
@@ -37,11 +39,14 @@
3739
},
3840
"scripts": {
3941
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
40-
"test": "vendor/bin/phpunit --colors=always --no-coverage",
41-
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
42+
"test": "vendor/bin/pest --colors=always",
43+
"test-coverage": "vendor/bin/pest --coverage --coverage-html coverage"
4244
},
4345
"config": {
44-
"sort-packages": true
46+
"sort-packages": true,
47+
"allow-plugins": {
48+
"pestphp/pest-plugin": true
49+
}
4550
},
4651
"extra": {
4752
"laravel": {
@@ -52,4 +57,4 @@
5257
},
5358
"minimum-stability": "dev",
5459
"prefer-stable": true
55-
}
60+
}

config/laravel-patches.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
<?php
22

33
return [
4-
'table_name' => 'patches',
4+
/**
5+
* Table name for storing patch information
6+
*/
7+
'table_name' => env('PATCHES_TABLE_NAME', 'patches'),
8+
9+
/**
10+
* Transaction settings
11+
*/
12+
'use_transactions' => env('PATCHES_USE_TRANSACTIONS', false),
13+
14+
/**
15+
* Error handling
16+
*/
17+
'stop_on_error' => env('PATCHES_STOP_ON_ERROR', true),
18+
'log_errors' => env('PATCHES_LOG_ERRORS', true),
19+
20+
/**
21+
* Metadata tracking
22+
*/
23+
'track_metadata' => env('PATCHES_TRACK_METADATA', true),
24+
'track_memory' => env('PATCHES_TRACK_MEMORY', true),
25+
'track_user' => env('PATCHES_TRACK_USER', true),
26+
27+
/**
28+
* Display settings
29+
*/
30+
'show_descriptions' => env('PATCHES_SHOW_DESCRIPTIONS', true),
531
];
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class AddMetadataToPatchesTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table(config('laravel-patches.table_name'), function (Blueprint $table) {
15+
$table->integer('execution_time_ms')->nullable()->after('log');
16+
$table->decimal('memory_used_mb', 8, 2)->nullable()->after('execution_time_ms');
17+
$table->string('executed_by')->nullable()->after('memory_used_mb');
18+
$table->string('environment', 50)->nullable()->after('executed_by');
19+
$table->enum('status', ['success', 'failed', 'rolled_back'])->default('success')->after('environment');
20+
$table->text('error_message')->nullable()->after('status');
21+
$table->longText('error_trace')->nullable()->after('error_message');
22+
});
23+
}
24+
25+
/**
26+
* Reverse the migrations.
27+
*/
28+
public function down(): void
29+
{
30+
Schema::table(config('laravel-patches.table_name'), function (Blueprint $table) {
31+
$table->dropColumn([
32+
'execution_time_ms',
33+
'memory_used_mb',
34+
'executed_by',
35+
'environment',
36+
'status',
37+
'error_message',
38+
'error_trace',
39+
]);
40+
});
41+
}
42+
}

0 commit comments

Comments
 (0)