How to customize data before saving when creating a new option in a modal

When creating a new option via modal, how to customize the data before saving.
    Forms\Components\Select::make('tag_id')
        ->relationship('tag', 'name')
        ->createOptionForm([
            Forms\Components\TextInput::make('name')
                ->required()
                ->reactive()
                ->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state)))
                ->maxLength(255),
            Forms\Components\TextInput::make('slug')
                ->required()
                ->maxLength(255),
        ])
        ->required(),

Need to add
user_id
to the tag, and there is no TagResource so no way to customize in CreateTag page, is there any other way to do it?
Was this page helpful?