Skip to content

Commit a3129ee

Browse files
authored
Merge pull request #96 from tarfin-labs/laravel-12
Laravel 12.x Compatibility
2 parents f19fac3 + 6ed01b1 commit a3129ee

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

.github/workflows/pest.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,26 @@ name: Pest
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
7+
- '*.x'
68
pull_request:
7-
branches: [main]
89

910
jobs:
1011
test:
11-
runs-on: ${{ matrix.os }}
12+
runs-on: ubuntu-latest
13+
1214
strategy:
1315
fail-fast: true
1416
matrix:
15-
os: [ubuntu-latest]
16-
php: [8.2, 8.3]
17-
laravel: [10.*, 11.*]
17+
php: [8.2, 8.3, 8.4]
18+
laravel: [10, 11, 12]
1819
stability: [prefer-lowest, prefer-stable]
19-
include:
20-
- laravel: 10.*
21-
testbench: 8.*
22-
- laravel: 11.*
23-
testbench: 9.*
20+
exclude:
21+
- php: 8.4
22+
laravel: 10
2423

25-
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
24+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}
2625

2726
steps:
2827
- name: Checkout code
@@ -33,7 +32,8 @@ jobs:
3332
with:
3433
php-version: ${{ matrix.php }}
3534
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
36-
coverage: pcov
35+
coverage: xdebug
36+
ini-values: xdebug.mode=coverage
3737

3838
- name: Setup problem matchers
3939
run: |
@@ -42,7 +42,7 @@ jobs:
4242
4343
- name: Install dependencies
4444
run: |
45-
composer require "laravel/framework:${{ matrix.laravel }}" --${{ matrix.stability }} --prefer-dist --no-interaction
45+
composer update --prefer-dist --no-interaction --no-progress --with="illuminate/contracts:^${{ matrix.laravel }}"
4646
4747
- name: List Installed Dependencies
4848
run: composer show -D

composer.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@
1616
}
1717
],
1818
"require": {
19-
"php": "^8.2|^8.3",
20-
"illuminate/contracts": "^10.0|^11.0",
19+
"php": "^8.2|^8.3|^8.4",
20+
"illuminate/contracts": "^10.48.4|^11.0.8|^12.0",
2121
"nikic/php-parser": "^5.4",
22-
"spatie/laravel-data": "^3.3",
22+
"spatie/laravel-data": "^4.13.0",
2323
"spatie/laravel-package-tools": "^1.14.0"
2424
},
2525
"require-dev": {
2626
"infection/infection": "^0.29.6",
2727
"laravel/pint": "^1.0",
28-
"larastan/larastan": "^2.0",
29-
"orchestra/testbench": "^8.0|^9.0",
30-
"pestphp/pest": "^2.34",
31-
"pestphp/pest-plugin-arch": "^2.7",
32-
"pestphp/pest-plugin-laravel": "^2.4",
33-
"pestphp/pest-plugin-type-coverage": "^2.8"
28+
"larastan/larastan": "^3.1.0",
29+
"orchestra/testbench": "^8.23.1|^9.0|^10.0",
30+
"pestphp/pest": "^3.0",
31+
"pestphp/pest-plugin-arch": "^3.0",
32+
"pestphp/pest-plugin-laravel": "^3.0",
33+
"pestphp/pest-plugin-type-coverage": "^3.0"
3434
},
3535
"autoload": {
3636
"psr-4": {

src/Transformers/ModelTransformer.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Spatie\LaravelData\Support\DataProperty;
88
use Spatie\LaravelData\Transformers\Transformer;
9+
use Spatie\LaravelData\Support\Transformation\TransformationContext;
910

1011
/**
1112
* Class ModelTransformer.
@@ -23,7 +24,7 @@ class ModelTransformer implements Transformer
2324
*
2425
* @return mixed The transformed value.
2526
*/
26-
public function transform(DataProperty $property, mixed $value): mixed
27+
public function transform(DataProperty $property, mixed $value, TransformationContext $context): mixed
2728
{
2829
return $value->id;
2930
}

0 commit comments

Comments
 (0)