diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index b78f75f..fd9ce47 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 1af21d3..b210283 100644 --- a/composer.json +++ b/composer.json @@ -43,11 +43,11 @@ }, "require": { "php": "^8.3", - "bezhansalleh/filament-shield": "^3.3", + "bezhansalleh/filament-shield": "^4.0", "datalinx/php-utils": "^2.5", "eclipsephp/common": "dev-main", "eclipsephp/core": "dev-main", - "filament/filament": "^3.3", + "filament/filament": "^4.0", "laravel/framework": "^12.0", "spatie/laravel-package-tools": "^1.19" }, diff --git a/src/Admin/Filament/Pages/ManageFrontend.php b/src/Admin/Filament/Pages/ManageFrontend.php index c692ad8..38e0f59 100644 --- a/src/Admin/Filament/Pages/ManageFrontend.php +++ b/src/Admin/Filament/Pages/ManageFrontend.php @@ -5,31 +5,32 @@ use BezhanSalleh\FilamentShield\Traits\HasPageShield; use Eclipse\Common\CommonPlugin; use Eclipse\Frontend\Settings\FrontendSettings; -use Filament\Forms\Components; -use Filament\Forms\Form; +use Filament\Forms\Components\Toggle; use Filament\Pages\SettingsPage; +use Filament\Schemas\Components\Section; +use Filament\Schemas\Schema; use Illuminate\Contracts\Support\Htmlable; class ManageFrontend extends SettingsPage { use HasPageShield; - protected static ?string $navigationIcon = 'heroicon-o-building-storefront'; + protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-building-storefront'; protected static string $settings = FrontendSettings::class; - public function form(Form $form): Form + public function form(Schema $schema): Schema { - return $form - ->schema([ - Components\Section::make('User access')->schema([ - Components\Toggle::make('guest_access') + return $schema + ->components([ + Section::make('User access')->schema([ + Toggle::make('guest_access') ->label('Enable guest access') ->helperText('If enabled, users will not be required to login to access the frontend.'), - Components\Toggle::make('enable_logins') + Toggle::make('enable_logins') ->label('Enable user logins') ->helperText('If enabled, users will be able to login and manage their user account.'), - Components\Toggle::make('allow_registration') + Toggle::make('allow_registration') ->label('Allow user registrations') ->helperText('Allow new users to register on this site.'), ]), diff --git a/src/Filament/Pages/Home.php b/src/Filament/Pages/Home.php index 0fe22fa..cd1007b 100644 --- a/src/Filament/Pages/Home.php +++ b/src/Filament/Pages/Home.php @@ -3,21 +3,22 @@ namespace Eclipse\Frontend\Filament\Pages; use Filament\Pages\Page; +use Filament\Panel; class Home extends Page { protected static ?int $navigationSort = -1; - protected static ?string $navigationIcon = ''; + protected static string|\BackedEnum|null $navigationIcon = ''; - protected static string $view = 'frontend-panel::filament.pages.home'; + protected string $view = 'frontend-panel::filament.pages.home'; public function getHeading(): string { return ''; } - public static function getSlug(): string + public static function getSlug(?Panel $panel = null): string { return '/'; } diff --git a/src/Providers/FrontendPanelProvider.php b/src/Providers/FrontendPanelProvider.php index d31089a..23453f5 100644 --- a/src/Providers/FrontendPanelProvider.php +++ b/src/Providers/FrontendPanelProvider.php @@ -11,14 +11,15 @@ use Filament\Http\Middleware\AuthenticateSession; use Filament\Http\Middleware\DisableBladeIconComponents; use Filament\Http\Middleware\DispatchServingFilamentEvent; -use Filament\Pages; +use Filament\Pages\Dashboard; use Filament\Panel; use Filament\PanelProvider; use Filament\Support\Colors\Color; use Filament\Support\Enums\Platform; use Filament\Support\Facades\FilamentView; use Filament\View\PanelsRenderHook; -use Filament\Widgets; +use Filament\Widgets\AccountWidget; +use Filament\Widgets\FilamentInfoWidget; use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse; use Illuminate\Cookie\Middleware\EncryptCookies; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; @@ -53,10 +54,10 @@ public function panel(Panel $panel): Panel $pages[] = CustomPages\Home::class; } else { $widgets = array_merge($widgets, [ - Widgets\AccountWidget::class, - Widgets\FilamentInfoWidget::class, + AccountWidget::class, + FilamentInfoWidget::class, ]); - $pages[] = Pages\Dashboard::class; + $pages[] = Dashboard::class; } $panel diff --git a/tests/Pest.php b/tests/Pest.php index a5fd441..3c15268 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -1,6 +1,7 @@ use(Illuminate\Foundation\Testing\RefreshDatabase::class) + ->use(RefreshDatabase::class) ->beforeEach(function () { $this->seed(CoreSeeder::class); })