Relation Manager Modal - How can I get the related model already selected.

Hi, I have two models, Business and Comment. On "Business Resource" edit I have a Relation Manager to show its comments. If I want to create a new comment by clicking "New Comment", on the appearing modal how can I get the related business already selected? I have tried
Forms\Components\Select::make('business_id')
->options(function (RelationManager $livewire): array {
return $livewire->ownerRecord->business()
->pluck('title', 'id')
->toArray();
}),
Forms\Components\Select::make('business_id')
->options(function (RelationManager $livewire): array {
return $livewire->ownerRecord->business()
->pluck('title', 'id')
->toArray();
}),
Any advice... Thank you.
2 Replies
Dan Harrin
Dan Harrin2y ago
you dont need the Select at all we will attach the comment to the correct business for you
Pablo Torres
Pablo TorresOP2y ago
Amazing! Thank you!
Want results from more Discord servers?
Add your server