© 2026 Hedgehog Software, LLC

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

Relationship Repeater in EditRecord saves before beforeSave?

What I am trying to do:
Create a group of changes when someone creates or updates records in Filament. Some of the elements are repeaters with relationships.

What I did:
I'm able to do this properly in the CreateRecord because all of the creating happens between beforeCreate and afterCreate. However, in the EditRecord I tried to use the beforeSave and afterSave, but the relationship repeater ends up being saved within the
$data = $this->form->getState()
$data = $this->form->getState()


$this->callHook('beforeValidate');

$data = $this->form->getState();

$this->callHook('afterValidate');
$this->callHook('beforeValidate');

$data = $this->form->getState();

$this->callHook('afterValidate');


My issue/the error:
I tried to get around the issue by adding my grouping code into the beforeValidate, but then I end up with empty groups when the validation fails.

My question:
Is there some other event that I haven't found yet that I can listen within the EditRecord page that will trigger after all the validation, and before any relationship repeaters are saved?

My initial expectation was that the EditRecord would perform all of it's saving between beforeSave and afterSave, but it doesn't appear that's the case.
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

Nested/indirect relationship in EditRecord
FilamentFFilament / ❓┊help
3y ago
Issue with halt() on beforeSave and a repeater with relationship
FilamentFFilament / ❓┊help
2y ago
Custom action before EditRecord
FilamentFFilament / ❓┊help
2y ago
BelongsToMany relationship in Repeater
FilamentFFilament / ❓┊help
3y ago