Accessing $records in hintAction

I have a form field and would like to access the record I'm editing in a hint action...
Textarea::make()
->rows(3)
->hintAction(
Forms\Components\Actions\Action::make('generate_title')
->icon('heroicon-o-arrow-path')
->action(function (?Role $record, Set $set) {
ray($record);
...
Textarea::make()
->rows(3)
->hintAction(
Forms\Components\Actions\Action::make('generate_title')
->icon('heroicon-o-arrow-path')
->action(function (?Role $record, Set $set) {
ray($record);
...
Record is null here... what's the right way to access the record? Thanks!
Solution:
Try fn ($livewire) => $livewire->getRecord()
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Koch16mo ago
Try fn ($livewire) => $livewire->getRecord()
martin-ro
martin-roOP16mo ago
That works, Danke!
Want results from more Discord servers?
Add your server