Skip to content
Discussion options

You must be logged in to vote

The issue stems from relationship hydration taking precedence after save. Add afterStateHydrated to force null state: ->afterStateHydrated(function ($state, $set, $get) { if ($get('type') === TransactionType::income->value) { $set('recipient_id', null); } }). Alternatively, use ->saveRelationshipsUsing(fn($get) => $get('type') === TransactionType::income->value ? null : function() {}) as suggested in issue #17778. This is an open issue in Filament v4.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@oktavianoandy
Comment options

Answer selected by oktavianoandy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants