From c3455387ce56ba69d9721b3dbbb8c952e23d7846 Mon Sep 17 00:00:00 2001 From: Kilian Trunk Date: Wed, 8 Oct 2025 15:34:23 +0200 Subject: [PATCH] refactor: migrate to f4 (EC-206) * feat: migrate to f4 * chore: re-add catalogue plugin * chore: format * chore: remove fork reference * ci: run tests for forks --- .github/workflows/test-runner.yml | 8 +++----- composer.json | 6 +++--- src/Admin/Filament/Clusters/Settings.php | 2 +- src/CommonPlugin.php | 3 ++- src/Foundation/Plugins/Plugin.php | 3 ++- src/Providers/GlobalSearchProvider.php | 2 +- tests/Pest.php | 1 - workbench/database/factories/UserFactory.php | 2 +- 8 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index b81008c..eeb42db 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -1,15 +1,13 @@ name: Tests on: - # Run testing on all push and pull requests for the main branch that have committed changes in PHP files + # Run testing on all push and pull requests that have committed changes in PHP files push: - branches: [ "main" ] paths: - - '**.php' + - '**/*.php' pull_request: - branches: [ "main" ] paths: - - '**.php' + - '**/*.php' # Make it possible to run the workflow manually workflow_dispatch: diff --git a/composer.json b/composer.json index 37984ab..348a13b 100644 --- a/composer.json +++ b/composer.json @@ -40,10 +40,10 @@ }, "require": { "php": "^8.2", - "bezhansalleh/filament-shield": "^3.3", + "bezhansalleh/filament-shield": "^4.0", "datalinx/php-utils": "^2.5", - "filament/filament": "^3.3", - "filament/spatie-laravel-settings-plugin": "^3.3", + "filament/filament": "^4.0", + "filament/spatie-laravel-settings-plugin": "^4.0", "laravel/scout": "^10.14", "spatie/laravel-package-tools": "^1.19" }, diff --git a/src/Admin/Filament/Clusters/Settings.php b/src/Admin/Filament/Clusters/Settings.php index ff894c2..d3897b3 100644 --- a/src/Admin/Filament/Clusters/Settings.php +++ b/src/Admin/Filament/Clusters/Settings.php @@ -6,7 +6,7 @@ class Settings extends Cluster { - protected static ?string $navigationIcon = 'heroicon-o-cog-6-tooth'; + protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-cog-6-tooth'; public static function getNavigationLabel(): string { diff --git a/src/CommonPlugin.php b/src/CommonPlugin.php index 3288d92..e4a42c1 100644 --- a/src/CommonPlugin.php +++ b/src/CommonPlugin.php @@ -3,8 +3,9 @@ namespace Eclipse\Common; use Eclipse\Common\Admin\Filament\Clusters\Settings; +use Eclipse\Common\Foundation\Plugins\Plugin; -class CommonPlugin extends Foundation\Plugins\Plugin +class CommonPlugin extends Plugin { /** * Cluster that is used for grouping app and plugin settings diff --git a/src/Foundation/Plugins/Plugin.php b/src/Foundation/Plugins/Plugin.php index 1e07385..684a769 100644 --- a/src/Foundation/Plugins/Plugin.php +++ b/src/Foundation/Plugins/Plugin.php @@ -2,6 +2,7 @@ namespace Eclipse\Common\Foundation\Plugins; +use Exception; use Filament\Panel; use Illuminate\Support\Str; use ReflectionClass; @@ -36,7 +37,7 @@ public function __construct() /** * Register any plugin services. * - * @throws \Exception + * @throws Exception */ public function register(Panel $panel): void { diff --git a/src/Providers/GlobalSearchProvider.php b/src/Providers/GlobalSearchProvider.php index 2f7fe89..e334d14 100644 --- a/src/Providers/GlobalSearchProvider.php +++ b/src/Providers/GlobalSearchProvider.php @@ -10,7 +10,7 @@ /** * Global search provider that uses Laravel Scout for resources/models that implement it */ -class GlobalSearchProvider implements \Filament\GlobalSearch\Contracts\GlobalSearchProvider +class GlobalSearchProvider implements \Filament\GlobalSearch\Providers\Contracts\GlobalSearchProvider { public function getResults(string $query): ?GlobalSearchResults { diff --git a/tests/Pest.php b/tests/Pest.php index 34e804d..f464441 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -22,7 +22,6 @@ '--all' => null, '--panel' => 'admin', '--option' => 'permissions', - '--minimal' => null, ]); }) ->in(__DIR__); diff --git a/workbench/database/factories/UserFactory.php b/workbench/database/factories/UserFactory.php index dfcab01..8a58e9e 100644 --- a/workbench/database/factories/UserFactory.php +++ b/workbench/database/factories/UserFactory.php @@ -10,7 +10,7 @@ /** * @template TModel of \Workbench\App\Models\User * - * @extends \Illuminate\Database\Eloquent\Factories\Factory + * @extends Factory */ class UserFactory extends Factory {