I've created a polymorphic table -- Phones.
- A phone has a contactable_id and contactable_type.
- A phone can belong to a restaurant or a team_member.
- A restaurant has many phones. A team_member has many phones.
In Restaurant and Team_Member model:
public $morphMany = ['phones' => [ 'My\Site\Models\Phone', 'name' => 'contactable' ] ];
In Phone model:
public $morphTo = [ 'contactable' => [] ];
My question is how do I build a form for this in assignment in the Phone fields.yaml? Am I setting this up right?
Any help is super appreciated. Thanks
Last updated