Disable field while performing 'set'

Can Alpine be used to add a disabled attribute to a field while it's being updated?

Forms\Components\TextInput::make('name')
    ->afterStateUpdated(function (\Closure $set, ?string $state) {
        if (filled($state)) {
            // Temporarily disable the key to prevent any input while it's being updated
            $set('key', Str::slug($state));
        }
    })
    ->reactive(),
Forms\Components\TextInput::make('key')
Was this page helpful?