Save prefix values
How can I save the TextInput including the prefix? I know that I can extend the
handleRecordCreation
method but then I would have the string prefix saved to DB (this is actually wanted and needed) but showing or editing the record would have the prefix and the prefixed string - basically double prefixed.
Solution:Jump to solution
Some magic is happening behind the scenes I did not understood, so my workaround is:
remove
->reactive()
and set the value directly after update using ->afterStateUpdated(fn ($state, callable $set) => $set('code', Party::find($state)->code.'-'))
...1 Reply
Solution
Some magic is happening behind the scenes I did not understood, so my workaround is:
remove
->reactive()
and set the value directly after update using ->afterStateUpdated(fn ($state, callable $set) => $set('code', Party::find($state)->code.'-'))