Skip to content

fix: update registerRoutes to be compatible with Filament v4.8.0 - #1

Merged
hzlea merged 1 commit into
1.xfrom
alegbeleyehzl-patch-1
Mar 3, 2026
Merged

fix: update registerRoutes to be compatible with Filament v4.8.0#1
hzlea merged 1 commit into
1.xfrom
alegbeleyehzl-patch-1

Conversation

@hzlea

@hzlea hzlea commented Mar 3, 2026

Copy link
Copy Markdown
Owner

Filament v4.8.0 introduced "Configurable resources", which updated the Page::registerRoutes() signature to include an optional PageConfiguration parameter:

registerRoutes(Panel $panel, ?PageConfiguration $configuration = null)

ApiTokens::registerRoutes() was not updated to match, causing a PHP fatal error on autoload due to incompatible method signature inheritance.

  • Added the missing optional ?PageConfiguration $configuration = null parameter to restore compatibility with Filament v4.8.0+, and passed $configuration through to the internal static::routes() as well.

Fixes:

PHP Fatal error: Declaration of Filament\Jetstream\Pages\ApiTokens::registerRoutes(Filament\Panel $panel): void must be compatible with Filament\Pages\Page::registerRoutes(Filament\Panel $panel, ?Filament\Pages\PageConfiguration $configuration = null): void

Ref: https://github.com/filamentphp/filament/releases/tag/v4.8.0
Ref: filamentphp/filament#19225

Filament v4.8.0 introduced "Configurable resources", which updated the Page::registerRoutes() signature to include an optional PageConfiguration parameter:

  registerRoutes(Panel $panel, ?PageConfiguration $configuration = null)

ApiTokens::registerRoutes() was not updated to match, causing a PHP fatal error on autoload due to incompatible method signature inheritance.

Added the missing optional `?PageConfiguration $configuration = null` parameter to restore compatibility with Filament v4.8.0+, and passed $configuration through to the internal static::routes() as well.

Fixes:
  PHP Fatal error:  Declaration of Filament\Jetstream\Pages\ApiTokens::registerRoutes(Filament\Panel $panel): void must be compatible with Filament\Pages\Page::registerRoutes(Filament\Panel $panel, ?Filament\Pages\PageConfiguration $configuration = null): void

Ref: https://github.com/filamentphp/filament/releases/tag/v4.8.0
Ref: filamentphp/filament#19225
@hzlea
hzlea merged commit c1e7a7e into 1.x Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant