Skip to main content
The Page class is the foundation for creating custom pages in Filament panels. Pages can include forms, widgets, actions, and custom content, and can be organized within navigation groups and clusters.

Namespace

Filament\Pages\Page

Inheritance

Extends: Filament\Pages\BasePage Implements: HasActions, HasRenderHookScopes, HasSchemas

Type Parameters

  • TConfiguration - The page configuration class (extends PageConfiguration)

Static Methods

getUrl()

Generate a URL to this page.
public static function getUrl(
    array $parameters = [],
    bool $isAbsolute = true,
    ?string $panel = null,
    ?Model $tenant = null,
    bool $shouldGuessMissingParameters = false,
    ?string $configuration = null
): string
parameters
array<mixed>
default:"[]"
Additional route parameters.
isAbsolute
bool
default:"true"
Whether to generate an absolute URL.
panel
string | null
default:"null"
The panel ID. Defaults to the current panel.
tenant
Model | null
default:"null"
The tenant model for multi-tenancy.
shouldGuessMissingParameters
bool
default:"false"
Whether to guess missing route parameters.
configuration
string | null
default:"null"
The configuration key.
return
string
Returns the generated URL.

registerRoutes()

Register the routes for this page.
public static function registerRoutes(
    Panel $panel,
    ?PageConfiguration $configuration = null
): void
panel
Panel
The panel instance.
configuration
PageConfiguration | null
Optional page configuration.

registerNavigationItems()

Register navigation items for this page.
public static function registerNavigationItems(): void
This method is called automatically to register the page in the panel navigation.

getNavigationItems()

Get the navigation items for this page.
public static function getNavigationItems(): array
return
array<NavigationItem>
Returns an array of navigation items.

getRouteName()

Get the route name for this page.
public static function getRouteName(?Panel $panel = null): string
panel
Panel | null
The panel instance. Defaults to the current panel.
return
string
Returns the route name.

getNavigationLabel()

Get the navigation label for this page.
public static function getNavigationLabel(): string
return
string
Returns the navigation label.

getNavigationIcon()

Get the navigation icon for this page.
public static function getNavigationIcon(): string | BackedEnum | Htmlable | null
return
string | BackedEnum | Htmlable | null
Returns the icon identifier.

getNavigationGroup()

Get the navigation group for this page.
public static function getNavigationGroup(): string | UnitEnum | null
return
string | UnitEnum | null
Returns the navigation group name.

getNavigationSort()

Get the navigation sort order for this page.
public static function getNavigationSort(): ?int
return
int | null
Returns the sort order.

getNavigationBadge()

Get the navigation badge for this page.
public static function getNavigationBadge(): ?string
return
string | null
Returns the badge content.

getNavigationBadgeColor()

Get the navigation badge color.
public static function getNavigationBadgeColor(): string | array | null
return
string | array<string> | null
Returns the badge color.

shouldRegisterNavigation()

Check if this page should register navigation items.
public static function shouldRegisterNavigation(): bool
return
bool
Returns true if navigation should be registered.

isDiscovered()

Check if this page should be automatically discovered.
public static function isDiscovered(): bool
return
bool
Returns true if the page should be discovered.

getCluster()

Get the cluster this page belongs to.
public static function getCluster(): ?string
return
class-string<Cluster> | null
Returns the cluster class name or null.

Instance Methods

getLayout()

Get the layout view for this page.
public function getLayout(): string
return
string
Returns the layout view name.

getBreadcrumbs()

Get the breadcrumbs for this page.
public function getBreadcrumbs(): array
return
array<string>
Returns an array of breadcrumb labels.

getFooter()

Get the footer view for this page.
public function getFooter(): ?View
return
View | null
Returns the footer view or null.

getHeader()

Get the header view for this page.
public function getHeader(): ?View
return
View | null
Returns the header view or null.

content()

Define the content schema for this page.
public function content(Schema $schema): Schema
schema
Schema
The schema instance to configure.
return
Schema
Returns the configured schema.
Example:
use Filament\Schemas\Schema;
use Filament\Schemas\Components\Section;

public function content(Schema $schema): Schema
{
    return $schema
        ->components([
            Section::make('Content')
                ->schema([
                    // Components...
                ]),
        ]);
}

getHeaderWidgets()

Get the widgets to display in the page header.
protected function getHeaderWidgets(): array
return
array<class-string<Widget> | WidgetConfiguration>
Returns an array of widget configurations.

getFooterWidgets()

Get the widgets to display in the page footer.
protected function getFooterWidgets(): array
return
array<class-string<Widget> | WidgetConfiguration>
Returns an array of widget configurations.

getHeaderWidgetsColumns()

Get the column configuration for header widgets.
public function getHeaderWidgetsColumns(): int | array
return
int | array<string, ?int>
Returns the number of columns or responsive column configuration.

getFooterWidgetsColumns()

Get the column configuration for footer widgets.
public function getFooterWidgetsColumns(): int | array
return
int | array<string, ?int>
Returns the number of columns or responsive column configuration.

getWidgetData()

Get data to pass to page widgets.
public function getWidgetData(): array
return
array<string, mixed>
Returns an array of data to pass to widgets.

Properties

$cluster

protected static ?string $cluster = null;
The cluster class this page belongs to.

$navigationGroup

protected static string | UnitEnum | null $navigationGroup = null;
The navigation group for this page.

$navigationIcon

protected static string | BackedEnum | null $navigationIcon = null;
The navigation icon for this page.

$navigationLabel

protected static ?string $navigationLabel = null;
The navigation label for this page.

$navigationSort

protected static ?int $navigationSort = null;
The navigation sort order.

$shouldRegisterNavigation

protected static bool $shouldRegisterNavigation = true;
Whether this page should register navigation items.

Traits

  • CanAuthorizeAccess - Authorization checks
  • HasErrorNotifications - Error notification handling
  • HasRoutes - Route management
  • HasSubNavigation - Sub-navigation support
  • InteractsWithHeaderActions - Header action management

Build docs developers (and LLMs) love