Skip to content

Commit ffe5d24

Browse files
authored
Merge pull request #13 from rappasoft/develop
v4.0.0
2 parents 0110c20 + ad6cef7 commit ffe5d24

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

+5066
-288
lines changed

.github/workflows/run-tests.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,29 @@ jobs:
1010
test:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
13-
fail-fast: true
13+
fail-fast: false
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.1]
17-
laravel: [10.*]
16+
php: [8.2, 8.3, 8.4]
1817
stability: [prefer-lowest, prefer-stable]
1918
include:
20-
- laravel: 10.*
21-
testbench: 8.0
19+
- laravel: '11.*'
20+
- laravel: '12.*'
21+
php: 8.3
22+
- laravel: '12.*'
23+
php: 8.4
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
@@ -40,8 +42,8 @@ jobs:
4042
4143
- name: Install dependencies
4244
run: |
43-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
45+
composer require --dev "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
4446
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4547
4648
- name: Execute tests
47-
run: vendor/bin/phpunit
49+
run: ./vendor/bin/pest --ci

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
@@ -11,6 +11,11 @@ This package generates patch files in the same fashion Laravel generates migrati
1111

1212
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.
1313

14+
## Requirements
15+
16+
- PHP 8.2+
17+
- Laravel 11.x - 12.x
18+
1419
## Installation
1520

1621
You can install the package via composer:
@@ -19,6 +24,13 @@ You can install the package via composer:
1924
composer require rappasoft/laravel-patches
2025
```
2126

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

2436
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|^10.0",
25+
"pestphp/pest": "^2.0|^3.0",
26+
"pestphp/pest-plugin-laravel": "^3.0",
27+
"phpunit/phpunit": "^10.5|^11.5",
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)