© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Daniel Plomp

Get old state

I have two components in a Form. I can copy the value over from one component to the other. Now I want to have an action to undo this.
I tried the following:

->hintAction(
  Action::make('undoJobTitle')
      ->label('Herstel oude waarde')
      ->icon('heroicon-m-clipboard')
      ->action(function ($component, $livewire, $state, $set) {
  
          dd($component->getLivewire()->getOldFormState($component->getStatePath()));
  
      })
->hintAction(
  Action::make('undoJobTitle')
      ->label('Herstel oude waarde')
      ->icon('heroicon-m-clipboard')
      ->action(function ($component, $livewire, $state, $set) {
  
          dd($component->getLivewire()->getOldFormState($component->getStatePath()));
  
      })


Also, this:

dd($component->getOldState());
dd($component->getOldState());


Both return
null
null
after I changed the value of the field. Not sure if I'm doing it right. Maybe I have to save the form first, but that is not what I want.
Any ideas?
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

get filter state
FilamentFFilament / ❓┊help
3y ago
get form processing state
FilamentFFilament / ❓┊help
2y ago
Repeater afterStateUpdated not returning the old state
FilamentFFilament / ❓┊help
5mo ago
Get Relation Fieldset State / Set Outside State in Relationship Fieldset
FilamentFFilament / ❓┊help
2y ago