To to plug attribute from preloadRecordSelect RelationManager

Is there a way to pluck out a different column from the preload function below instead of having the Id show up in the dropdown by default?
Tables\Actions\AttachAction::make()
->label('Assign instructor')
->preloadRecordSelect(),
Tables\Actions\AttachAction::make()
->label('Assign instructor')
->preloadRecordSelect(),
9 Replies
Dennis Koch
Dennis Koch2y ago
The id shouldn be the default but the relation title attribute.
Dan Harrin
Dan Harrin2y ago
you can pass ->recordTitleAttribute() to customise it for that action only i think
Oxalate
OxalateOP2y ago
Let me have a look The relation title attribute as per the docs indicates I should add the attribute to identify the model so I understood it's the id.
Dennis Koch
Dennis Koch2y ago
I think it should be clear that „title“ doesn’t refer to the id 😅
Oxalate
OxalateOP2y ago
Yes that's right. In that case, I'll redo the relation manager. Or is there a way to change the attribute if already created?
Dan Harrin
Dan Harrin2y ago
theres a property
Dennis Koch
Dennis Koch2y ago
Sure, just change the property on the RM
Dan Harrin
Dan Harrin2y ago
you dont need to regenerate it
Oxalate
OxalateOP2y ago
Works now. Thank you very much.
Want results from more Discord servers?
Add your server