© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•8mo ago•
46 replies
charlie

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'),
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?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Validation with afterStateUpdatedJs()
FilamentFFilament / ❓┊help
4mo ago
Testing live() and afterStateUpdated()
FilamentFFilament / ❓┊help
3y ago
afterStateUpdated:squint:
FilamentFFilament / ❓┊help
14mo ago