Is there a way to modify option label strings in default AttachAction class?
I'm having issues attempting to modify option labels in Attach Action dropdown. What I want to do is to prefix them with string.
Tried various approaches from the docs but it seems they are being overwritten?
I know you can customise record title by setting
recordTitleAttribute()
method but that only allows us to choose different attribute on the model.
I cannot modify the model or migration.
I need a way to mutate options labels as the dropdown is populated.
Any help will be appreciated.Solution:Jump to solution
Turns out we can mutate options array that is generated by AttachAction by using
recordSelect
method like this:
```php
AttachAction::make()
->preloadRecordSelect()...1 Reply
Solution
Turns out we can mutate options array that is generated by AttachAction by using
recordSelect
method like this: