getResource method does not exist

I'm trying to use a Page class and the InteractsWithRecord trait, but I'm getting an error saying the getResource method doesn't exist. What am I doing wrong? Do I have to define this method in my class? The docs didn't mention anything about that.

class Detail extends Page
{
    use InteractsWithRecord;

    protected static ?string $navigationIcon = 'heroicon-o-clipboard-document-list';

    protected static string $view = 'filament.app.pages.location.detail';

    protected static ?string $title = 'Details';

    protected static ?string $slug = 'location/{record}/detail';

    protected static bool $shouldRegisterNavigation = false;

    public function mount(int | string $record): void
    {
        $this->record = $this->resolveRecord($record);
    }

    ...
}
Was this page helpful?