F
Filament14mo ago
toeknee

Relationship Manager - Custom Title Attributes?

I need to refine the title attribute for the select in the relationship manager attaching method. Any suggestions on the way to handle this? I need a few columns
Solution:
Solved it, use custom attached action i.e. ```php Tables\Actions\AttachAction::make() ->form(fn (AttachAction $action): array => [...
Jump to solution
1 Reply
Solution
toeknee
toeknee14mo ago
Solved it, use custom attached action i.e.
Tables\Actions\AttachAction::make()
->form(fn (AttachAction $action): array => [
Forms\Components\Select::make('recordId')
->preload()
->options(fn() => \App\Models\MyModel::query()
->get()
->mapWithKeys(fn($item) => [$item->id => $item->title . ' - ' . $item->part])
->toArray()
)
]),
Tables\Actions\AttachAction::make()
->form(fn (AttachAction $action): array => [
Forms\Components\Select::make('recordId')
->preload()
->options(fn() => \App\Models\MyModel::query()
->get()
->mapWithKeys(fn($item) => [$item->id => $item->title . ' - ' . $item->part])
->toArray()
)
]),
Want results from more Discord servers?
Add your server