Using both afterStateUpdated AND afterStateUpdatedJs

TextInput::make('title')
  ->live(onBlur: true)
  ->afterStateUpdatedJs(SlugGenerator::slugifyWithJs(fieldName: 'slug'))
  ->afterStateUpdated(function (?string $state, Set $set, ?Model $record) {
      $set('slug', SlugGenerator::unique($record, $state));
  }),

TextInput::make('slug'),


Here, the php one doesn't work.
Or maybe it's immediately updated with the JS one?
Was this page helpful?