afterStateUpdated() now working

Hey, I created a custom page where I want to update a fields value based on another fields value. I found in a docs an example which does exactly what I need
TextInput::make('title')
    ->live()
    ->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state))),
TextInput::make('slug')


The problem is that if I use this example on one of my resources it works correctly, but using it on my custom page it does not do anything. I checked the network tab and there are no requests made to the server whenever I write something in the input for the title.
Do I need to import a trait in my custom page class or something else in order for this to work as intended ?
Was this page helpful?