© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
HenkN

Refresh form after calling model function

maybe a stupid question, but I am scratching my head for a couple of days now.
I am using the default admin panel setup. When I in the form update the Status field, it will call a function in the model (setStatus in this case), this updates different fields in the model as well (with some more logic). Some of those fields are also visible in the form.

The problem now is that the other fields in the form are not updated with this call. How do I get those reloaded. If I put the logic of the model in the form with $set statements it works, but this is from maintenance point of view cumbersome). Is there a simple "->reload()" function I am overlooking.

Select::make('Status')
    ->options([
        'Ingevoerd' => 'Ingevoerd',
        'Aangeboden' => 'Aangeboden',
        'Ontvangen' => 'Ontvangen',
        'Afgehandeld' => 'Afgehandeld',
    ])->reactive()
    ->afterStateUpdated(function (Clothing $record, callable $get) {
        $record->setStatus($get('Status'));
        $record->save();
    })
    
Select::make('Status')
    ->options([
        'Ingevoerd' => 'Ingevoerd',
        'Aangeboden' => 'Aangeboden',
        'Ontvangen' => 'Ontvangen',
        'Afgehandeld' => 'Afgehandeld',
    ])->reactive()
    ->afterStateUpdated(function (Clothing $record, callable $get) {
        $record->setStatus($get('Status'));
        $record->save();
    })
    
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

Refresh field after modal form
FilamentFFilament / ❓┊help
3y ago
Refresh Form after suffix action
FilamentFFilament / ❓┊help
3y ago
Refresh form section description after save
FilamentFFilament / ❓┊help
2y ago
Refresh repeater items after save form
FilamentFFilament / ❓┊help
3y ago