How to set the value of the relationship form based on the parent form?

I'm trying to pre-fill a relationship form based on the parent form.
Tried with the following, but the form field inside the relationship is not populated. (Here slug field inside the schema of relationship)

TextInput::make('title')
    ->live()
    ->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', $state))
    
TextInput::make('slug')
Was this page helpful?