Skip to content

Commit f1c5beb

Browse files
authored
Support for Laravel 11 and PHP 8.3 (#553)
1 parent d86c18b commit f1c5beb

27 files changed

+1038
-733
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ jobs:
1010
fail-fast: true
1111
matrix:
1212
os: [ubuntu-22.04, windows-latest]
13-
php: [8.2, 8.1]
14-
laravel: [10.2]
13+
php: [8.3, 8.2]
14+
laravel: [11.0, 10.2]
15+
exclude:
16+
- laravel: 11.0
1517

1618
name: Test Stubs ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }}
1719

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

+9-19
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,23 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [8.2, 8.1, 8.0]
12-
laravel: [10.0, 9.0]
11+
php: [8.3, 8.2]
12+
laravel: [11.0, 10.0]
1313
db: [mysql, postgres, sqlite]
1414
ssr: [true, false]
1515
dependency-version: [prefer-lowest, prefer-stable]
1616
include:
17-
- laravel: 9.0
18-
testbench: 7.*
17+
- laravel: 11.0
18+
testbench: 9.*
1919
- laravel: 10.0
2020
testbench: 8.*
2121
exclude:
22-
- ssr: true
23-
dependency-version: prefer-lowest
24-
- ssr: true
25-
php: 8.1
26-
- ssr: true
27-
php: 8.0
22+
- dependency-version: prefer-lowest
23+
ssr: true
24+
- php: 8.2
25+
ssr: true
2826
- laravel: 10.0
29-
php: 8.0
27+
ssr: true
3028
- db: mysql
3129
ssr: true
3230
- db: postgres
@@ -122,14 +120,6 @@ jobs:
122120
composer require laravel/framework:^${{ matrix.laravel }} --no-interaction --no-suggest
123121
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
124122
125-
- name: Prepare L10
126-
if: ${{ matrix.laravel == '10.0' }}
127-
run: |
128-
cd app
129-
rm composer.lock
130-
composer require spatie/phpunit-snapshot-assertions:^5.0 phpunit/phpunit:^10.0 nunomaduro/collision:^7.0 --no-interaction --no-suggest
131-
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
132-
133123
- name: Prepare tests
134124
run: |
135125
cd app

.github/workflows/run-tests.yml

+14-18
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,20 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [8.2, 8.1, 8.0]
12-
laravel: [10.0, 9.0]
11+
php: [8.3, 8.2]
12+
laravel: [11.0, 10.0]
1313
ssr: [true, false]
1414
dependency-version: [prefer-lowest, prefer-stable]
1515
include:
16-
- laravel: 9.0
17-
testbench: 7.*
16+
- laravel: 11.0
17+
testbench: 9.*
1818
- laravel: 10.0
1919
testbench: 8.*
2020
exclude:
2121
- ssr: true
2222
dependency-version: prefer-lowest
2323
- ssr: true
24-
php: 8.1
25-
- ssr: true
26-
php: 8.0
27-
- laravel: 10.0
28-
php: 8.0
24+
php: 8.2
2925

3026
name: Test P${{ matrix.php }} - L${{ matrix.laravel }} - SSR ${{ matrix.ssr }} - ${{ matrix.dependency-version }}
3127

@@ -82,20 +78,20 @@ jobs:
8278
php artisan storage:link
8379
php artisan migrate:fresh --seed
8480
85-
- name: Prepare L9
86-
if: ${{ matrix.laravel == '9.0' }}
81+
- name: Prepare L10
82+
if: ${{ matrix.laravel == '10.0' }}
8783
run: |
8884
cd app
8985
rm composer.lock
90-
composer require illuminate/contracts:"<9.52" --no-interaction --no-suggest
86+
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
9187
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
9288
93-
- name: Prepare L10
94-
if: ${{ matrix.laravel == '10.0' }}
89+
- name: Prepare L11
90+
if: ${{ matrix.laravel == '11.0' }}
9591
run: |
9692
cd app
9793
rm composer.lock
98-
composer require illuminate/contracts:"<10.17" spatie/phpunit-snapshot-assertions:^5.0 phpunit/phpunit:^10.0 nunomaduro/collision:^7.0 --no-interaction --no-suggest
94+
composer require illuminate/contracts:^11.0.1 spatie/phpunit-snapshot-assertions:^5.0 phpunit/phpunit:^10.4 nunomaduro/collision:^8.1 --no-interaction --no-suggest
9995
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
10096
10197
- name: Prepare tests
@@ -109,10 +105,10 @@ jobs:
109105
cd app
110106
./vendor/laravel/dusk/bin/chromedriver-linux &
111107
112-
- name: Start Laravel Websockets
108+
- name: Start Laravel Reverb
113109
run: |
114110
cd app
115-
php artisan websockets:serve &
111+
php artisan reverb:start &
116112
117113
- name: Start SSR server
118114
run: |
@@ -136,7 +132,7 @@ jobs:
136132
with:
137133
timeout_minutes: 10
138134
max_attempts: 3
139-
command: cd app && php artisan dusk --stop-on-error --stop-on-failure --exclude-group=table
135+
command: cd app && php artisan dusk --stop-on-failure --stop-on-error --exclude-group=table
140136
on_retry_command: cd app && php artisan migrate:fresh --seed
141137

142138
- name: Upload Screenshots

app/.env.example

+14-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LOG_LEVEL=debug
1010

1111
DB_CONNECTION=sqlite
1212

13-
BROADCAST_DRIVER=pusher
13+
BROADCAST_DRIVER=reverb
1414
CACHE_DRIVER=file
1515
FILESYSTEM_DISK=local
1616
QUEUE_CONNECTION=sync
@@ -32,19 +32,19 @@ MAIL_ENCRYPTION=null
3232
MAIL_FROM_ADDRESS="[email protected]"
3333
MAIL_FROM_NAME="${APP_NAME}"
3434

35-
PUSHER_APP_ID=1234567
36-
PUSHER_APP_KEY=12345678901234567890
37-
PUSHER_APP_SECRET=12345678901234567890
38-
PUSHER_APP_CLUSTER=eu
39-
PUSHER_HOST=127.0.0.1
40-
PUSHER_PORT=6001
41-
PUSHER_SCHEME=http
42-
43-
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
44-
VITE_PUSHER_PORT="${PUSHER_PORT}"
45-
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
46-
VITE_PUSHER_HOST="${PUSHER_HOST}"
47-
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
35+
REVERB_HOST=127.0.0.1
36+
REVERB_PORT=8080
37+
REVERB_APP_KEY=12345678901234567890
38+
REVERB_APP_SECRET=12345678901234567890
39+
REVERB_APP_ID=1234567
40+
REVERB_SCHEME=http
41+
42+
VITE_REVERB_HOST="${REVERB_HOST}"
43+
VITE_REVERB_PORT="${REVERB_PORT}"
44+
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
45+
VITE_REVERB_APP_SECRET="${REVERB_APP_SECRET}"
46+
VITE_REVERB_APP_ID="${REVERB_APP_ID}"
47+
VITE_REVERB_SCHEME="${REVERB_SCHEME}"
4848

4949
DEBUGBAR_ENABLED=false
5050
SPLADE_SSR_ENABLED=false

app/.env.example.mysql

+14-14
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DB_USERNAME=protone_media_db_test
1414
DB_PASSWORD=secret
1515
DB_PORT=3306
1616

17-
BROADCAST_DRIVER=pusher
17+
BROADCAST_DRIVER=reverb
1818
CACHE_DRIVER=file
1919
FILESYSTEM_DISK=local
2020
QUEUE_CONNECTION=sync
@@ -36,19 +36,19 @@ MAIL_ENCRYPTION=null
3636
MAIL_FROM_ADDRESS="[email protected]"
3737
MAIL_FROM_NAME="${APP_NAME}"
3838

39-
PUSHER_APP_ID=1234567
40-
PUSHER_APP_KEY=12345678901234567890
41-
PUSHER_APP_SECRET=12345678901234567890
42-
PUSHER_APP_CLUSTER=eu
43-
PUSHER_HOST=127.0.0.1
44-
PUSHER_PORT=6001
45-
PUSHER_SCHEME=http
46-
47-
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
48-
VITE_PUSHER_PORT="${PUSHER_PORT}"
49-
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
50-
VITE_PUSHER_HOST="${PUSHER_HOST}"
51-
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
39+
REVERB_HOST=127.0.0.1
40+
REVERB_PORT=8080
41+
REVERB_APP_KEY=12345678901234567890
42+
REVERB_APP_SECRET=12345678901234567890
43+
REVERB_APP_ID=1234567
44+
REVERB_SCHEME=http
45+
46+
VITE_REVERB_HOST="${REVERB_HOST}"
47+
VITE_REVERB_PORT="${REVERB_PORT}"
48+
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
49+
VITE_REVERB_APP_SECRET="${REVERB_APP_SECRET}"
50+
VITE_REVERB_APP_ID="${REVERB_APP_ID}"
51+
VITE_REVERB_SCHEME="${REVERB_SCHEME}"
5252

5353
DEBUGBAR_ENABLED=false
5454
SPLADE_SSR_ENABLED=false

app/.env.example.postgres

+14-14
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DB_USERNAME=protone_media_db_test
1414
DB_PASSWORD=secret
1515
DB_PORT=5432
1616

17-
BROADCAST_DRIVER=pusher
17+
BROADCAST_DRIVER=reverb
1818
CACHE_DRIVER=file
1919
FILESYSTEM_DISK=local
2020
QUEUE_CONNECTION=sync
@@ -36,19 +36,19 @@ MAIL_ENCRYPTION=null
3636
MAIL_FROM_ADDRESS="[email protected]"
3737
MAIL_FROM_NAME="${APP_NAME}"
3838

39-
PUSHER_APP_ID=1234567
40-
PUSHER_APP_KEY=12345678901234567890
41-
PUSHER_APP_SECRET=12345678901234567890
42-
PUSHER_APP_CLUSTER=eu
43-
PUSHER_HOST=127.0.0.1
44-
PUSHER_PORT=6001
45-
PUSHER_SCHEME=http
46-
47-
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
48-
VITE_PUSHER_PORT="${PUSHER_PORT}"
49-
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
50-
VITE_PUSHER_HOST="${PUSHER_HOST}"
51-
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
39+
REVERB_HOST=127.0.0.1
40+
REVERB_PORT=8080
41+
REVERB_APP_KEY=12345678901234567890
42+
REVERB_APP_SECRET=12345678901234567890
43+
REVERB_APP_ID=1234567
44+
REVERB_SCHEME=http
45+
46+
VITE_REVERB_HOST="${REVERB_HOST}"
47+
VITE_REVERB_PORT="${REVERB_PORT}"
48+
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
49+
VITE_REVERB_APP_SECRET="${REVERB_APP_SECRET}"
50+
VITE_REVERB_APP_ID="${REVERB_APP_ID}"
51+
VITE_REVERB_SCHEME="${REVERB_SCHEME}"
5252

5353
DEBUGBAR_ENABLED=false
5454
SPLADE_SSR_ENABLED=false

app/.phpunit.cache/test-results

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":1,"defects":[],"times":{"Tests\\Browser\\Form\\RelationsTest::it_can_find_the_default_value_of_a_nested_relationship":0.692,"Tests\\Browser\\Form\\RelationsTest::it_can_handle_a_belongs_to_many_relationship":0.656,"Tests\\Browser\\Form\\RelationsTest::it_can_handle_a_belongs_to_many_relationship_with_the_choices_library":3.343,"Tests\\Browser\\Form\\RelationsTest::it_can_handle_a_morph_to_many_relationship":0.602,"Tests\\Browser\\Form\\RelationsTest::it_can_handle_a_relationship_with_checkboxes":0.526,"Tests\\Browser\\Form\\RelationsTest::it_can_have_two_forms_in_a_view_without_mixing_data":0.429}}

app/app/Models/User.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Foundation\Auth\User as Authenticatable;
77
use Illuminate\Notifications\Notifiable;
88
use Laravel\Sanctum\HasApiTokens;
9+
use Spatie\Image\Enums\Fit;
910
use Spatie\MediaLibrary\HasMedia;
1011
use Spatie\MediaLibrary\InteractsWithMedia;
1112
use Spatie\MediaLibrary\MediaCollections\Models\Media;
@@ -63,6 +64,6 @@ public function registerMediaCollections(): void
6364

6465
public function registerMediaConversions(?Media $media = null): void
6566
{
66-
$this->addMediaConversion('thumb')->fit('contain', 50, 50);
67+
$this->addMediaConversion('thumb')->fit(Fit::Contain, 50, 50);
6768
}
6869
}

app/composer.json

+11-13
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,36 @@
88
],
99
"license": "MIT",
1010
"require": {
11-
"php": "^8.0.2",
12-
"beyondcode/laravel-websockets": "^1.13",
11+
"php": "^8.3|^8.2",
1312
"guzzlehttp/guzzle": "^7.2",
14-
"kirschbaum-development/eloquent-power-joins": "^2.6",
15-
"laravel/framework": "^9.19",
16-
"laravel/sanctum": "^3.2",
13+
"kirschbaum-development/eloquent-power-joins": "^3.0",
14+
"laravel/framework": "^10.48.2|^11.0.1",
15+
"laravel/reverb": "^1.0@beta",
16+
"laravel/sanctum": "^3.2|^4.0",
1717
"laravel/tinker": "^2.7",
1818
"maatwebsite/excel": "^3.1",
19-
"monolog/monolog": "^2.0|^3.0",
19+
"monolog/monolog": "^3.0",
2020
"nesbot/carbon": "^2.63",
2121
"psr/simple-cache": "^2.0",
22-
"pusher/pusher-php-server": "^7.0,<7.2.0",
2322
"ramsey/collection": "^1.2",
24-
"spatie/laravel-medialibrary": "^10.7",
23+
"spatie/laravel-medialibrary": "^11.0",
2524
"spatie/laravel-query-builder": "^5.0"
2625
},
2726
"require-dev": {
2827
"barryvdh/laravel-debugbar": "^3.7",
2928
"fakerphp/faker": "^1.9.1",
30-
"laravel/dusk": "^7.9.2",
29+
"laravel/dusk": "^7.9.2|^8.0",
3130
"laravel/sail": "^1.0.1",
3231
"mockery/mockery": "^1.4.4",
33-
"nunomaduro/collision": "^6.1",
34-
"phpunit/phpunit": "^9.5.10",
32+
"nunomaduro/collision": "^7.10|^8.1",
33+
"phpunit/phpunit": "^10.4",
3534
"protonemedia/laravel-splade": "*",
3635
"spatie/ignition": "^1.4.1",
3736
"spatie/invade": "^1.1",
3837
"spatie/fractalistic": "^2.9",
3938
"spatie/laravel-ignition": "^1.0|^2.0",
4039
"spatie/laravel-ray": "^1.31",
41-
"spatie/phpunit-snapshot-assertions": "^4.2|^5.0",
42-
"thiagocordeiro/laravel-translator": "^1.2"
40+
"spatie/phpunit-snapshot-assertions": "^5.0"
4341
},
4442
"autoload": {
4543
"psr-4": {

app/config/broadcasting.php

+16
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,22 @@
3030

3131
'connections' => [
3232

33+
'reverb' => [
34+
'driver' => 'reverb',
35+
'key' => env('REVERB_APP_KEY'),
36+
'secret' => env('REVERB_APP_SECRET'),
37+
'app_id' => env('REVERB_APP_ID'),
38+
'options' => [
39+
'host' => env('REVERB_HOST'),
40+
'port' => env('REVERB_PORT', 443),
41+
'scheme' => env('REVERB_SCHEME', 'https'),
42+
'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
43+
],
44+
'client_options' => [
45+
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
46+
],
47+
],
48+
3349
'pusher' => [
3450
'driver' => 'pusher',
3551
'key' => env('PUSHER_APP_KEY'),

0 commit comments

Comments
 (0)