Skip to content

Commit 7fab8a2

Browse files
Laravel 12.x Compatibility (#651)
1 parent 99be3d7 commit 7fab8a2

File tree

95 files changed

+477
-644
lines changed

Some content is hidden

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

95 files changed

+477
-644
lines changed

.github/workflows/run-stub-tests.yml

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: run-stub-tests
22

3-
on: [push, pull_request]
3+
on:
4+
- push
5+
- pull_request
46

57
jobs:
68
stub-test:
@@ -11,7 +13,7 @@ jobs:
1113
matrix:
1214
os: [ubuntu-22.04, windows-latest]
1315
php: [8.4, 8.3, 8.2]
14-
laravel: [11.0, 10.2]
16+
laravel: [10.2, 11.0]
1517
exclude:
1618
- php: 8.4
1719
laravel: 10.0
@@ -33,17 +35,17 @@ jobs:
3335
3436
- name: Remove installed Splade (Unix)
3537
run: rm -rf vendor/protonemedia/laravel-splade
36-
if: matrix.os == 'ubuntu-22.04'
38+
if: "matrix.os == 'ubuntu-22.04'"
3739

3840
- name: Remove installed Splade (Windows)
3941
run: rd "vendor/protonemedia/laravel-splade" /s /q
4042
shell: cmd
41-
if: matrix.os == 'windows-latest'
43+
if: "matrix.os == 'windows-latest'"
4244

4345
- name: Checkout code
4446
uses: actions/checkout@v4.2.2
4547
with:
46-
path: "vendor/protonemedia/laravel-splade"
48+
path: vendor/protonemedia/laravel-splade
4749

4850
- name: Install Splade
4951
run: |
@@ -59,47 +61,47 @@ jobs:
5961
run: |
6062
rm -rf node_modules/@protonemedia/laravel-splade/dist
6163
cp -R vendor/protonemedia/laravel-splade/dist node_modules/@protonemedia/laravel-splade/
62-
if: matrix.os == 'ubuntu-22.04'
64+
if: "matrix.os == 'ubuntu-22.04'"
6365

6466
- name: Remove installed Splade and copy front-end build from Checkout (Windows)
6567
run: |
6668
rd "node_modules/@protonemedia/laravel-splade/dist" /s /q
6769
mkdir "node_modules/@protonemedia/laravel-splade/dist"
6870
xcopy "vendor/protonemedia/laravel-splade/dist" "node_modules/@protonemedia/laravel-splade/dist" /E /I
6971
shell: cmd
70-
if: matrix.os == 'windows-latest'
72+
if: "matrix.os == 'windows-latest'"
7173

7274
- name: Compile assets
7375
run: npm run build
7476

7577
- name: Run Laravel Server (Unix)
7678
run: php artisan serve &
77-
if: matrix.os == 'ubuntu-22.04'
79+
if: "matrix.os == 'ubuntu-22.04'"
7880

7981
- name: Run Test (Unix)
8082
run: php vendor/protonemedia/laravel-splade/TestStubs.php
81-
if: matrix.os == 'ubuntu-22.04'
83+
if: "matrix.os == 'ubuntu-22.04'"
8284

8385
- name: Run Laravel Server (Windows) and Run Test
8486
run: |
8587
start /b cmd /v:on /c "(php artisan serve) &"
8688
php vendor/protonemedia/laravel-splade/TestStubs.php
8789
shell: cmd
88-
if: matrix.os == 'windows-latest'
90+
if: "matrix.os == 'windows-latest'"
8991

9092
- name: Start SSR server (Unix)
9193
run: |
9294
echo "SPLADE_SSR_ENABLED=true" >> .env
9395
node bootstrap/ssr/ssr.js &
94-
if: matrix.os == 'ubuntu-22.04'
96+
if: "matrix.os == 'ubuntu-22.04'"
9597

9698
- name: Run Test command (Unix)
9799
run: php artisan splade:ssr-test
98-
if: matrix.os == 'ubuntu-22.04'
100+
if: "matrix.os == 'ubuntu-22.04'"
99101

100102
- name: Start SSR server (Windows) and Run Test command
101103
run: |
102104
echo "SPLADE_SSR_ENABLED=true" >> .env
103105
node bootstrap/ssr/ssr.js &
104106
php artisan splade:ssr-test
105-
if: matrix.os == 'windows-latest'
107+
if: "matrix.os == 'windows-latest'"

.github/workflows/run-table-tests.yml

+20-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
name: run-table-tests
22

3-
on: [push, pull_request]
3+
on:
4+
- push
5+
- pull_request
46

57
jobs:
68
table-test:
79
runs-on: ubuntu-latest
10+
811
strategy:
912
fail-fast: true
1013
matrix:
1114
php: [8.4, 8.3, 8.2]
12-
laravel: [11.0, 10.0]
15+
laravel: [10.0, 11.0, 12.0]
1316
db: [mysql, postgres, sqlite]
1417
ssr: [true, false]
1518
dependency-version: [prefer-lowest, prefer-stable]
1619
include:
20+
- laravel: 12.0
21+
testbench: 10.*
1722
- laravel: 11.0
1823
testbench: 9.*
1924
- laravel: 10.0
2025
testbench: 8.*
26+
2127
exclude:
2228
- dependency-version: prefer-lowest
2329
ssr: true
@@ -68,20 +74,19 @@ jobs:
6874
env:
6975
cache-name: cache-node-modules
7076
with:
71-
# npm cache files are stored in `~/.npm` on Linux/macOS
7277
path: ~/.npm
7378
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
7479
restore-keys: |
7580
${{ runner.os }}-build-${{ env.cache-name }}-
7681
${{ runner.os }}-build-
7782
${{ runner.os }}-
7883
79-
- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
84+
- if: "${{ steps.cache-npm.outputs.cache-hit == 'false' }}"
8085
name: List the state of node modules
8186
continue-on-error: true
8287
run: npm list
8388

84-
- name: "Install locked dependencies with npm"
89+
- name: Install locked dependencies with npm
8590
run: |
8691
npm ci --ignore-scripts
8792
@@ -99,19 +104,19 @@ jobs:
99104
coverage: none
100105

101106
- name: Prepare environment file (MySQL)
102-
if: ${{ matrix.db == 'mysql' }}
107+
if: "${{ matrix.db == 'mysql' }}"
103108
run: |
104109
cd app
105110
cp .env.example.mysql .env
106111
107112
- name: Prepare environment file (PostgreSQL)
108-
if: ${{ matrix.db == 'postgres' }}
113+
if: "${{ matrix.db == 'postgres' }}"
109114
run: |
110115
cd app
111116
cp .env.example.postgres .env
112117
113118
- name: Prepare environment file (SQLite)
114-
if: ${{ matrix.db == 'sqlite' }}
119+
if: "${{ matrix.db == 'sqlite' }}"
115120
run: |
116121
cd app
117122
cp .env.example .env
@@ -140,15 +145,15 @@ jobs:
140145
cd app
141146
sed -i -e "s|SPLADE_SSR_ENABLED=false|SPLADE_SSR_ENABLED=true|g" .env
142147
node bootstrap/ssr/ssr.mjs &
143-
if: matrix.ssr == true
148+
if: "matrix.ssr == true"
144149

145150
- name: Migrate DB and Run Laravel Server (MySQL)
146151
run: |
147152
cd app
148153
php artisan storage:link
149154
php artisan migrate:fresh --seed
150155
php artisan serve &
151-
if: ${{ matrix.db == 'mysql' }}
156+
if: "${{ matrix.db == 'mysql' }}"
152157
env:
153158
DB_PORT: ${{ job.services.mysql.ports[3306] }}
154159

@@ -158,20 +163,20 @@ jobs:
158163
php artisan storage:link
159164
php artisan migrate:fresh --seed
160165
php artisan serve &
161-
if: ${{ matrix.db == 'postgres' }}
166+
if: "${{ matrix.db == 'postgres' }}"
162167
env:
163168
DB_PORT: ${{ job.services.postgres.ports[5432] }}
164169

165170
- name: Migrate DB and Run Laravel Server (SQLite)
166-
if: ${{ matrix.db == 'sqlite' }}
171+
if: "${{ matrix.db == 'sqlite' }}"
167172
run: |
168173
cd app
169174
php artisan storage:link
170175
php artisan migrate:fresh --seed
171176
php artisan serve &
172177
173178
- name: Execute Dusk tests (only table tests - MySQL)
174-
if: ${{ matrix.db == 'mysql' }}
179+
if: "${{ matrix.db == 'mysql' }}"
175180
uses: nick-invision/retry@v3
176181
with:
177182
timeout_minutes: 10
@@ -182,7 +187,7 @@ jobs:
182187
DB_PORT: ${{ job.services.mysql.ports[3306] }}
183188

184189
- name: Execute Dusk tests (only table tests - PostgreSQL)
185-
if: ${{ matrix.db == 'postgres' }}
190+
if: "${{ matrix.db == 'postgres' }}"
186191
uses: nick-invision/retry@v3
187192
with:
188193
timeout_minutes: 10
@@ -193,7 +198,7 @@ jobs:
193198
DB_PORT: ${{ job.services.postgres.ports[5432] }}
194199

195200
- name: Execute Dusk tests (only table tests - SQLite)
196-
if: ${{ matrix.db == 'sqlite' }}
201+
if: "${{ matrix.db == 'sqlite' }}"
197202
uses: nick-invision/retry@v3
198203
with:
199204
timeout_minutes: 10

.github/workflows/run-tests.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
name: run-tests
22

3-
on: [push, pull_request]
3+
on:
4+
- push
5+
- pull_request
46

57
jobs:
68
test:
79
runs-on: ubuntu-latest
10+
811
strategy:
912
fail-fast: true
1013
matrix:
1114
php: [8.4, 8.3, 8.2]
12-
laravel: [11.0, 10.0]
15+
laravel: [10.0, 11.0, 12.0]
1316
ssr: [true, false]
1417
dependency-version: [prefer-lowest, prefer-stable]
1518
include:
19+
- laravel: 12.0
20+
testbench: 10.*
1621
- laravel: 11.0
1722
testbench: 9.*
1823
- laravel: 10.0
@@ -39,20 +44,19 @@ jobs:
3944
env:
4045
cache-name: cache-node-modules
4146
with:
42-
# npm cache files are stored in `~/.npm` on Linux/macOS
4347
path: ~/.npm
4448
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
4549
restore-keys: |
4650
${{ runner.os }}-build-${{ env.cache-name }}-
4751
${{ runner.os }}-build-
4852
${{ runner.os }}-
4953
50-
- if: ${{ steps.cache-npm.outputs.cache-hit == 'false' }}
54+
- if: "${{ steps.cache-npm.outputs.cache-hit == 'false' }}"
5155
name: List the state of node modules
5256
continue-on-error: true
5357
run: npm list
5458

55-
- name: "Install locked dependencies with npm"
59+
- name: Install locked dependencies with npm
5660
run: |
5761
npm ci --ignore-scripts
5862
@@ -83,15 +87,15 @@ jobs:
8387
php artisan migrate:fresh --seed
8488
8589
- name: Prepare L10
86-
if: ${{ matrix.laravel == '10.0' }}
90+
if: "${{ matrix.laravel == '10.0' }}"
8791
run: |
8892
cd app
8993
rm composer.lock
9094
composer require illuminate/contracts:^10.48.2 spatie/phpunit-snapshot-assertions:^5.0 phpunit/phpunit:^10.4 nunomaduro/collision:^7.10 --no-interaction --no-suggest
9195
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
9296
9397
- name: Prepare L11
94-
if: ${{ matrix.laravel == '11.0' }}
98+
if: "${{ matrix.laravel == '11.0' }}"
9599
run: |
96100
cd app
97101
rm composer.lock
@@ -119,7 +123,7 @@ jobs:
119123
cd app
120124
sed -i -e "s|SPLADE_SSR_ENABLED=false|SPLADE_SSR_ENABLED=true|g" .env
121125
node bootstrap/ssr/ssr.mjs &
122-
if: matrix.ssr == true
126+
if: "matrix.ssr == true"
123127

124128
- name: Run Laravel Server
125129
run: |

app/app/Models/Project.php

-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44

55
use Illuminate\Database\Eloquent\Factories\HasFactory;
66
use Illuminate\Database\Eloquent\Model;
7-
use Kirschbaum\PowerJoins\PowerJoins;
87

98
class Project extends Model
109
{
1110
use HasFactory;
12-
use PowerJoins;
1311

1412
protected $guarded = [];
1513

app/composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@
1010
"require": {
1111
"php": "^8.4|^8.3|^8.2",
1212
"guzzlehttp/guzzle": "^7.2",
13-
"kirschbaum-development/eloquent-power-joins": "^3.0",
14-
"laravel/framework": "^10.48.23|^11.33",
13+
"kirschbaum-development/eloquent-power-joins": "^4.0",
14+
"laravel/framework": "^10.48.23|^11.33|^12.0",
1515
"laravel/reverb": "^1.4.3",
1616
"laravel/sanctum": "^3.2|^4.0",
1717
"laravel/tinker": "^2.7",
1818
"maatwebsite/excel": "^3.1",
1919
"monolog/monolog": "^3.0",
20-
"nesbot/carbon": "^2.63",
20+
"nesbot/carbon": "^2.63|^3.0",
2121
"psr/simple-cache": "^2.0",
2222
"ramsey/collection": "^1.2",
2323
"spatie/laravel-medialibrary": "^11.0",
24-
"spatie/laravel-query-builder": "^5.0"
24+
"spatie/laravel-query-builder": "^5.0|^6.0|dev-main"
2525
},
2626
"require-dev": {
2727
"barryvdh/laravel-debugbar": "^3.7",
2828
"fakerphp/faker": "^1.9.1",
2929
"laravel/dusk": "^8.2.11",
3030
"mockery/mockery": "^1.4.4",
3131
"nunomaduro/collision": "^7.10|^8.1",
32-
"phpunit/phpunit": "^10.4",
32+
"phpunit/phpunit": "^10.4|^11.5.3",
3333
"protonemedia/laravel-splade": "*",
3434
"spatie/ignition": "^1.4.1",
3535
"spatie/invade": "^1.1",

app/tests/Browser/AuthTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class AuthTest extends DuskTestCase
99
{
10-
/** @test */
10+
#[\PHPUnit\Framework\Attributes\Test]
1111
public function it_handles_the_login_redirect()
1212
{
1313
$this->browse(function (Browser $browser) {

app/tests/Browser/Bridge/InlineTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class InlineTest extends DuskTestCase
99
{
10-
/** @test */
10+
#[\PHPUnit\Framework\Attributes\Test]
1111
public function it_supports_inline_templates()
1212
{
1313
$this->browse(function (Browser $browser) {

app/tests/Browser/Bridge/MethodTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class MethodTest extends DuskTestCase
1010
{
11-
/** @test */
11+
#[\PHPUnit\Framework\Attributes\Test]
1212
public function it_can_call_a_php_method_without_losing_state()
1313
{
1414
$this->browse(function (Browser $browser) {
@@ -24,7 +24,7 @@ public function it_can_call_a_php_method_without_losing_state()
2424
});
2525
}
2626

27-
/** @test */
27+
#[\PHPUnit\Framework\Attributes\Test]
2828
public function it_can_call_a_php_method_with_arguments()
2929
{
3030
$this->browse(function (Browser $browser) {
@@ -40,7 +40,7 @@ public function it_can_call_a_php_method_with_arguments()
4040
});
4141
}
4242

43-
/** @test */
43+
#[\PHPUnit\Framework\Attributes\Test]
4444
public function it_can_save_eloquent_models_and_refresh_the_state()
4545
{
4646
$this->browse(function (Browser $browser) {

0 commit comments

Comments
 (0)