© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
9 replies
ddoddsr

Why is my $record->save(); not working

Should I expect one of these to save the current record?

Action::make('Run Campaign')
     ->action(function (Campaign $record, Set $set) {
         $set('status_id', CampaignStatusEnum::Run );
         $record->save();
    }),
Action::make('Run Campaign')
     ->action(function (Campaign $record, Set $set) {
         $set('status_id', CampaignStatusEnum::Run );
         $record->save();
    }),

Or
 Action::make('Pause Campaign')
->action(function (?Model $record, Set $set) {
    $set('status_id', CampaignStatusEnum::Paused );
    $record->save();
})
 Action::make('Pause Campaign')
->action(function (?Model $record, Set $set) {
    $set('status_id', CampaignStatusEnum::Paused );
    $record->save();
})

The field changes on the scren but is not save.
Solution
in your case if you want to update the model you need to do

 Action::make('Pause Campaign')
->action(function (?Model $record) {
    $record->status_id = CampaignStatusEnum::Paused;
    $record->save();
})
 Action::make('Pause Campaign')
->action(function (?Model $record) {
    $record->status_id = CampaignStatusEnum::Paused;
    $record->save();
})
Jump to solution
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

Why isn't my record classes not working?
FilamentFFilament / ❓┊help
3y ago
Follow/Unfollow record is not working
FilamentFFilament / ❓┊help
16mo ago
Why selectColumn is not working
FilamentFFilament / ❓┊help
2y ago
$record->relationship->fieldData not working
FilamentFFilament / ❓┊help
2y ago