Skip to content

Commit

Permalink
Support for Laravel 11 and PHP 8.3 (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbaljet authored Mar 17, 2024
1 parent d86c18b commit f1c5beb
Show file tree
Hide file tree
Showing 27 changed files with 1,038 additions and 733 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/run-stub-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-22.04, windows-latest]
php: [8.2, 8.1]
laravel: [10.2]
php: [8.3, 8.2]
laravel: [11.0, 10.2]
exclude:
- laravel: 11.0

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

Expand Down
28 changes: 9 additions & 19 deletions .github/workflows/run-table-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,23 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.2, 8.1, 8.0]
laravel: [10.0, 9.0]
php: [8.3, 8.2]
laravel: [11.0, 10.0]
db: [mysql, postgres, sqlite]
ssr: [true, false]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 9.0
testbench: 7.*
- laravel: 11.0
testbench: 9.*
- laravel: 10.0
testbench: 8.*
exclude:
- ssr: true
dependency-version: prefer-lowest
- ssr: true
php: 8.1
- ssr: true
php: 8.0
- dependency-version: prefer-lowest
ssr: true
- php: 8.2
ssr: true
- laravel: 10.0
php: 8.0
ssr: true
- db: mysql
ssr: true
- db: postgres
Expand Down Expand Up @@ -122,14 +120,6 @@ jobs:
composer require laravel/framework:^${{ matrix.laravel }} --no-interaction --no-suggest
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Prepare L10
if: ${{ matrix.laravel == '10.0' }}
run: |
cd app
rm composer.lock
composer require spatie/phpunit-snapshot-assertions:^5.0 phpunit/phpunit:^10.0 nunomaduro/collision:^7.0 --no-interaction --no-suggest
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Prepare tests
run: |
cd app
Expand Down
32 changes: 14 additions & 18 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,20 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [8.2, 8.1, 8.0]
laravel: [10.0, 9.0]
php: [8.3, 8.2]
laravel: [11.0, 10.0]
ssr: [true, false]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 9.0
testbench: 7.*
- laravel: 11.0
testbench: 9.*
- laravel: 10.0
testbench: 8.*
exclude:
- ssr: true
dependency-version: prefer-lowest
- ssr: true
php: 8.1
- ssr: true
php: 8.0
- laravel: 10.0
php: 8.0
php: 8.2

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

Expand Down Expand Up @@ -82,20 +78,20 @@ jobs:
php artisan storage:link
php artisan migrate:fresh --seed
- name: Prepare L9
if: ${{ matrix.laravel == '9.0' }}
- name: Prepare L10
if: ${{ matrix.laravel == '10.0' }}
run: |
cd app
rm composer.lock
composer require illuminate/contracts:"<9.52" --no-interaction --no-suggest
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
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Prepare L10
if: ${{ matrix.laravel == '10.0' }}
- name: Prepare L11
if: ${{ matrix.laravel == '11.0' }}
run: |
cd app
rm composer.lock
composer require illuminate/contracts:"<10.17" spatie/phpunit-snapshot-assertions:^5.0 phpunit/phpunit:^10.0 nunomaduro/collision:^7.0 --no-interaction --no-suggest
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
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Prepare tests
Expand All @@ -109,10 +105,10 @@ jobs:
cd app
./vendor/laravel/dusk/bin/chromedriver-linux &
- name: Start Laravel Websockets
- name: Start Laravel Reverb
run: |
cd app
php artisan websockets:serve &
php artisan reverb:start &
- name: Start SSR server
run: |
Expand All @@ -136,7 +132,7 @@ jobs:
with:
timeout_minutes: 10
max_attempts: 3
command: cd app && php artisan dusk --stop-on-error --stop-on-failure --exclude-group=table
command: cd app && php artisan dusk --stop-on-failure --stop-on-error --exclude-group=table
on_retry_command: cd app && php artisan migrate:fresh --seed

- name: Upload Screenshots
Expand Down
28 changes: 14 additions & 14 deletions app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LOG_LEVEL=debug

DB_CONNECTION=sqlite

BROADCAST_DRIVER=pusher
BROADCAST_DRIVER=reverb
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
Expand All @@ -32,19 +32,19 @@ MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

PUSHER_APP_ID=1234567
PUSHER_APP_KEY=12345678901234567890
PUSHER_APP_SECRET=12345678901234567890
PUSHER_APP_CLUSTER=eu
PUSHER_HOST=127.0.0.1
PUSHER_PORT=6001
PUSHER_SCHEME=http

VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
REVERB_HOST=127.0.0.1
REVERB_PORT=8080
REVERB_APP_KEY=12345678901234567890
REVERB_APP_SECRET=12345678901234567890
REVERB_APP_ID=1234567
REVERB_SCHEME=http

VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_APP_SECRET="${REVERB_APP_SECRET}"
VITE_REVERB_APP_ID="${REVERB_APP_ID}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"

DEBUGBAR_ENABLED=false
SPLADE_SSR_ENABLED=false
28 changes: 14 additions & 14 deletions app/.env.example.mysql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DB_USERNAME=protone_media_db_test
DB_PASSWORD=secret
DB_PORT=3306

BROADCAST_DRIVER=pusher
BROADCAST_DRIVER=reverb
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
Expand All @@ -36,19 +36,19 @@ MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

PUSHER_APP_ID=1234567
PUSHER_APP_KEY=12345678901234567890
PUSHER_APP_SECRET=12345678901234567890
PUSHER_APP_CLUSTER=eu
PUSHER_HOST=127.0.0.1
PUSHER_PORT=6001
PUSHER_SCHEME=http

VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
REVERB_HOST=127.0.0.1
REVERB_PORT=8080
REVERB_APP_KEY=12345678901234567890
REVERB_APP_SECRET=12345678901234567890
REVERB_APP_ID=1234567
REVERB_SCHEME=http

VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_APP_SECRET="${REVERB_APP_SECRET}"
VITE_REVERB_APP_ID="${REVERB_APP_ID}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"

DEBUGBAR_ENABLED=false
SPLADE_SSR_ENABLED=false
28 changes: 14 additions & 14 deletions app/.env.example.postgres
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DB_USERNAME=protone_media_db_test
DB_PASSWORD=secret
DB_PORT=5432

BROADCAST_DRIVER=pusher
BROADCAST_DRIVER=reverb
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
Expand All @@ -36,19 +36,19 @@ MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

PUSHER_APP_ID=1234567
PUSHER_APP_KEY=12345678901234567890
PUSHER_APP_SECRET=12345678901234567890
PUSHER_APP_CLUSTER=eu
PUSHER_HOST=127.0.0.1
PUSHER_PORT=6001
PUSHER_SCHEME=http

VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
REVERB_HOST=127.0.0.1
REVERB_PORT=8080
REVERB_APP_KEY=12345678901234567890
REVERB_APP_SECRET=12345678901234567890
REVERB_APP_ID=1234567
REVERB_SCHEME=http

VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_APP_SECRET="${REVERB_APP_SECRET}"
VITE_REVERB_APP_ID="${REVERB_APP_ID}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"

DEBUGBAR_ENABLED=false
SPLADE_SSR_ENABLED=false
1 change: 1 addition & 0 deletions app/.phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +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}}
3 changes: 2 additions & 1 deletion app/app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Spatie\Image\Enums\Fit;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
Expand Down Expand Up @@ -63,6 +64,6 @@ public function registerMediaCollections(): void

public function registerMediaConversions(?Media $media = null): void
{
$this->addMediaConversion('thumb')->fit('contain', 50, 50);
$this->addMediaConversion('thumb')->fit(Fit::Contain, 50, 50);
}
}
24 changes: 11 additions & 13 deletions app/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,36 @@
],
"license": "MIT",
"require": {
"php": "^8.0.2",
"beyondcode/laravel-websockets": "^1.13",
"php": "^8.3|^8.2",
"guzzlehttp/guzzle": "^7.2",
"kirschbaum-development/eloquent-power-joins": "^2.6",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.2",
"kirschbaum-development/eloquent-power-joins": "^3.0",
"laravel/framework": "^10.48.2|^11.0.1",
"laravel/reverb": "^1.0@beta",
"laravel/sanctum": "^3.2|^4.0",
"laravel/tinker": "^2.7",
"maatwebsite/excel": "^3.1",
"monolog/monolog": "^2.0|^3.0",
"monolog/monolog": "^3.0",
"nesbot/carbon": "^2.63",
"psr/simple-cache": "^2.0",
"pusher/pusher-php-server": "^7.0,<7.2.0",
"ramsey/collection": "^1.2",
"spatie/laravel-medialibrary": "^10.7",
"spatie/laravel-medialibrary": "^11.0",
"spatie/laravel-query-builder": "^5.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.7",
"fakerphp/faker": "^1.9.1",
"laravel/dusk": "^7.9.2",
"laravel/dusk": "^7.9.2|^8.0",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"nunomaduro/collision": "^7.10|^8.1",
"phpunit/phpunit": "^10.4",
"protonemedia/laravel-splade": "*",
"spatie/ignition": "^1.4.1",
"spatie/invade": "^1.1",
"spatie/fractalistic": "^2.9",
"spatie/laravel-ignition": "^1.0|^2.0",
"spatie/laravel-ray": "^1.31",
"spatie/phpunit-snapshot-assertions": "^4.2|^5.0",
"thiagocordeiro/laravel-translator": "^1.2"
"spatie/phpunit-snapshot-assertions": "^5.0"
},
"autoload": {
"psr-4": {
Expand Down
16 changes: 16 additions & 0 deletions app/config/broadcasting.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@

'connections' => [

'reverb' => [
'driver' => 'reverb',
'key' => env('REVERB_APP_KEY'),
'secret' => env('REVERB_APP_SECRET'),
'app_id' => env('REVERB_APP_ID'),
'options' => [
'host' => env('REVERB_HOST'),
'port' => env('REVERB_PORT', 443),
'scheme' => env('REVERB_SCHEME', 'https'),
'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],

'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
Expand Down
Loading

0 comments on commit f1c5beb

Please sign in to comment.