From ed233b71f25fe5660aeace254785992a4568ca8d Mon Sep 17 00:00:00 2001 From: Antoni Siek Date: Mon, 27 Apr 2026 14:53:57 +0200 Subject: [PATCH 1/7] feat: laravel 13 --- .github/workflows/run-tests.yml | 58 +++++++++++++++++++++++++++++++++ composer.json | 18 +++++----- phpstan.neon.dist | 1 - 3 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/run-tests.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..df08b0c --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,58 @@ +name: tests + +on: + push: + branches: [main] + paths: + - '**.php' + - 'composer.json' + - 'composer.lock' + - 'phpunit.xml.dist' + - '.github/workflows/run-tests.yml' + pull_request: + paths: + - '**.php' + - 'composer.json' + - 'composer.lock' + - 'phpunit.xml.dist' + - '.github/workflows/run-tests.yml' + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.2', '8.3', '8.4'] + laravel: ['11.*', '12.*', '13.*'] + stability: [prefer-stable] + include: + - laravel: '11.*' + testbench: '9.*' + - laravel: '12.*' + testbench: '10.*' + - laravel: '13.*' + testbench: '11.*' + exclude: + - laravel: '13.*' + php: '8.2' + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} + + steps: + - uses: actions/checkout@v6 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, fileinfo + coverage: none + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update + composer update --${{ matrix.stability }} --prefer-dist --no-interaction + + - name: Run tests + run: vendor/bin/pest diff --git a/composer.json b/composer.json index 98cfdaf..8f0ae72 100644 --- a/composer.json +++ b/composer.json @@ -25,19 +25,19 @@ "filament/tables": "^4.0|^5.0", "filament/infolists": "^4.0|^5.0", "spatie/laravel-package-tools": "^1.15.0", - "illuminate/contracts": "^11.28|^12.0" + "illuminate/contracts": "^11.28|^12.0|^13.0" }, "require-dev": { "laravel/pint": "^1.0", - "nunomaduro/collision": "^7.9", - "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^8.0", - "pestphp/pest": "^2.0", - "pestphp/pest-plugin-arch": "^2.0", - "pestphp/pest-plugin-laravel": "^2.0", + "nunomaduro/collision": "^8.0", + "larastan/larastan": "^3.0", + "orchestra/testbench": "^9.0|^10.0|^11.0", + "pestphp/pest": "^3.0", + "pestphp/pest-plugin-arch": "^3.0", + "pestphp/pest-plugin-laravel": "^3.0", "phpstan/extension-installer": "^1.1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", "spatie/laravel-ray": "^1.26" }, "autoload": { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 9914a5e..a89f28c 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -8,5 +8,4 @@ parameters: tmpDir: build/phpstan checkOctaneCompatibility: true checkModelProperties: true - checkMissingIterableValueType: false From 40e58550dfe267dfb31f690e071484114914f2b9 Mon Sep 17 00:00:00 2001 From: Antoni Siek Date: Mon, 27 Apr 2026 15:02:03 +0200 Subject: [PATCH 2/7] chore: phpstan --- src/SimpleLightBoxPlugin.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/SimpleLightBoxPlugin.php b/src/SimpleLightBoxPlugin.php index 456388c..891fa0a 100644 --- a/src/SimpleLightBoxPlugin.php +++ b/src/SimpleLightBoxPlugin.php @@ -29,7 +29,7 @@ public function boot(Panel $panel): void $url = $livewire->evaluate($url); } - if (! is_string($url) || is_null($url) || empty($url)) { + if (! is_string($url) || empty($url)) { $url = null; } @@ -37,12 +37,11 @@ public function boot(Panel $panel): void }; ImageColumn::macro('simpleLightbox', macro: function ($url = null, $defaultDisplayUrl = true) use ($ensureLightBoxUrl) { - + /** @var ImageColumn $this */ if ($defaultDisplayUrl) { $this->defaultImageUrl($url); } - /** @phpstan-ignore-next-line */ return $this ->openUrlInNewTab() ->action(fn () => null) // override default action for table row @@ -51,12 +50,11 @@ public function boot(Panel $panel): void }); ImageEntry::macro('simpleLightbox', function ($url = null, $defaultDisplayUrl = true) use ($ensureLightBoxUrl) { - + /** @var ImageEntry $this */ if ($defaultDisplayUrl) { $this->defaultImageUrl($url); } - /** @phpstan-ignore-next-line */ return $this ->openUrlInNewTab() ->extraAttributes(fn () => ['x-on:click' => 'SimpleLightBox.open(event, \'' . $ensureLightBoxUrl($url, $this) . '\')'], true) @@ -64,12 +62,11 @@ public function boot(Panel $panel): void }); TextColumn::macro('simpleLightbox', function ($url = null, $defaultDisplayUrl = true) use ($ensureLightBoxUrl) { - + /** @var TextColumn $this */ if ($defaultDisplayUrl) { $this->default($url); } - /** @phpstan-ignore-next-line */ return $this ->openUrlInNewTab() ->url($url) @@ -77,12 +74,11 @@ public function boot(Panel $panel): void }); TextEntry::macro('simpleLightbox', function ($url = null, $defaultDisplayUrl = true) { - + /** @var TextEntry $this */ if ($defaultDisplayUrl) { $this->default($url); } - /** @phpstan-ignore-next-line */ return $this ->openUrlInNewTab() // ->extraAttributes(array_merge($extraAttributes, ['x-on:click' => 'SimpleLightBox.open(event, \'' . $url . '\')'])); From 370afaa50c743f997d038b28456389fa1808c8b1 Mon Sep 17 00:00:00 2001 From: Antoni Siek Date: Mon, 27 Apr 2026 15:14:14 +0200 Subject: [PATCH 3/7] chore: phpstan --- src/SimpleLightBoxPlugin.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SimpleLightBoxPlugin.php b/src/SimpleLightBoxPlugin.php index 891fa0a..c6f7076 100644 --- a/src/SimpleLightBoxPlugin.php +++ b/src/SimpleLightBoxPlugin.php @@ -37,7 +37,7 @@ public function boot(Panel $panel): void }; ImageColumn::macro('simpleLightbox', macro: function ($url = null, $defaultDisplayUrl = true) use ($ensureLightBoxUrl) { - /** @var ImageColumn $this */ + /** @var ImageColumn $this */ // @phpstan-ignore varTag.nativeType (Macroable rebinds $this to the target class at runtime) if ($defaultDisplayUrl) { $this->defaultImageUrl($url); } @@ -50,7 +50,7 @@ public function boot(Panel $panel): void }); ImageEntry::macro('simpleLightbox', function ($url = null, $defaultDisplayUrl = true) use ($ensureLightBoxUrl) { - /** @var ImageEntry $this */ + /** @var ImageEntry $this */ // @phpstan-ignore varTag.nativeType (Macroable rebinds $this to the target class at runtime) if ($defaultDisplayUrl) { $this->defaultImageUrl($url); } @@ -58,11 +58,11 @@ public function boot(Panel $panel): void return $this ->openUrlInNewTab() ->extraAttributes(fn () => ['x-on:click' => 'SimpleLightBox.open(event, \'' . $ensureLightBoxUrl($url, $this) . '\')'], true) - ->extraImgAttributes(['class' => 'simple-light-box-img-indicator'], true); + ->extraImgAttributes(['class' => 'simple-light-box-img-indicator']); }); TextColumn::macro('simpleLightbox', function ($url = null, $defaultDisplayUrl = true) use ($ensureLightBoxUrl) { - /** @var TextColumn $this */ + /** @var TextColumn $this */ // @phpstan-ignore varTag.nativeType (Macroable rebinds $this to the target class at runtime) if ($defaultDisplayUrl) { $this->default($url); } @@ -74,7 +74,7 @@ public function boot(Panel $panel): void }); TextEntry::macro('simpleLightbox', function ($url = null, $defaultDisplayUrl = true) { - /** @var TextEntry $this */ + /** @var TextEntry $this */ // @phpstan-ignore varTag.nativeType (Macroable rebinds $this to the target class at runtime) if ($defaultDisplayUrl) { $this->default($url); } From 87c684fbdff051a4ce79f52d691477f092fc3894 Mon Sep 17 00:00:00 2001 From: Antoni Siek Date: Mon, 27 Apr 2026 15:18:30 +0200 Subject: [PATCH 4/7] chore: consolidate workflows --- .github/workflows/phpstan.yml | 26 -------------------------- .github/workflows/run-tests.yml | 7 +++++++ 2 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/phpstan.yml diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml deleted file mode 100644 index 2c6185e..0000000 --- a/.github/workflows/phpstan.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: PHPStan - -on: - push: - paths: - - '**.php' - - 'phpstan.neon.dist' - -jobs: - phpstan: - name: phpstan - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - coverage: none - - - name: Install composer dependencies - uses: ramsey/composer-install@v4 - - - name: Run PHPStan - run: ./vendor/bin/phpstan --error-format=github diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index df08b0c..6bd498a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,6 +8,8 @@ on: - 'composer.json' - 'composer.lock' - 'phpunit.xml.dist' + - 'phpstan.neon.dist' + - 'phpstan-baseline.neon' - '.github/workflows/run-tests.yml' pull_request: paths: @@ -15,6 +17,8 @@ on: - 'composer.json' - 'composer.lock' - 'phpunit.xml.dist' + - 'phpstan.neon.dist' + - 'phpstan-baseline.neon' - '.github/workflows/run-tests.yml' jobs: @@ -56,3 +60,6 @@ jobs: - name: Run tests run: vendor/bin/pest + + - name: Run PHPStan + run: vendor/bin/phpstan analyse --error-format=github From 6e5968c7d7673650908f5e9b2186044bdf20cfdf Mon Sep 17 00:00:00 2001 From: Antoni Siek Date: Mon, 27 Apr 2026 15:24:56 +0200 Subject: [PATCH 5/7] fix: deps --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 8f0ae72..6474a8d 100644 --- a/composer.json +++ b/composer.json @@ -32,9 +32,9 @@ "nunomaduro/collision": "^8.0", "larastan/larastan": "^3.0", "orchestra/testbench": "^9.0|^10.0|^11.0", - "pestphp/pest": "^3.0", - "pestphp/pest-plugin-arch": "^3.0", - "pestphp/pest-plugin-laravel": "^3.0", + "pestphp/pest": "^3.0|^4.0", + "pestphp/pest-plugin-arch": "^3.0|^4.0", + "pestphp/pest-plugin-laravel": "^3.0|^4.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-phpunit": "^2.0", From 76168b1a8db3e1fddab520014a2432066f9bd04f Mon Sep 17 00:00:00 2001 From: Antoni Siek Date: Mon, 27 Apr 2026 15:26:45 +0200 Subject: [PATCH 6/7] fix: tests --- tests/TestCase.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 2d6a692..7601658 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -9,8 +9,6 @@ use Filament\Forms\FormsServiceProvider; use Filament\Infolists\InfolistsServiceProvider; use Filament\Notifications\NotificationsServiceProvider; -use Filament\SpatieLaravelSettingsPluginServiceProvider; -use Filament\SpatieLaravelTranslatablePluginServiceProvider; use Filament\Support\SupportServiceProvider; use Filament\Tables\TablesServiceProvider; use Filament\Widgets\WidgetsServiceProvider; @@ -43,8 +41,6 @@ protected function getPackageProviders($app) InfolistsServiceProvider::class, LivewireServiceProvider::class, NotificationsServiceProvider::class, - SpatieLaravelSettingsPluginServiceProvider::class, - SpatieLaravelTranslatablePluginServiceProvider::class, SupportServiceProvider::class, TablesServiceProvider::class, WidgetsServiceProvider::class, From ef692def449b5891265e06fc800b9004be45917e Mon Sep 17 00:00:00 2001 From: Antoni Siek Date: Mon, 27 Apr 2026 15:34:47 +0200 Subject: [PATCH 7/7] fix: coverage --- phpunit.xml.dist | 7 ------- 1 file changed, 7 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index aaa4d82..3ce399f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -20,13 +20,6 @@ tests - - - - - - -