Skip to content

Commit a86e070

Browse files
authored
fix: update registerRoutes to be compatible with Filament v4.8.0
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
1 parent 4cfb330 commit a86e070

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/Pages/ApiTokens.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Filament\Jetstream\Pages;
44

55
use Filament\Pages\Page;
6+
use Filament\Pages\PageConfiguration;
67
use Filament\Panel;
78
use Illuminate\Support\Facades\Route;
89

@@ -25,17 +26,17 @@ public static function getRelativeRouteName(Panel $panel): string
2526
return 'tokens';
2627
}
2728

28-
public static function registerRoutes(Panel $panel): void
29+
public static function registerRoutes(Panel $panel, ?PageConfiguration $configuration = null): void
2930
{
3031
if (filled(static::getCluster())) {
3132
Route::name(static::prependClusterRouteBaseName($panel, ''))
3233
->prefix(static::prependClusterSlug($panel, ''))
33-
->group(fn () => static::routes($panel));
34+
->group(fn () => static::routes($panel, $configuration));
3435

3536
return;
3637
}
3738

38-
static::routes($panel);
39+
static::routes($panel, $configuration);
3940
}
4041

4142
public static function getRouteName(string | Panel | null $panel = null): string

0 commit comments

Comments
 (0)