Saving related items when editing/creating a resource

Hi Everyone,

I'm trying to setup so that when I'm on the create/edit screen of my resource, I can add multiple items with a repeater and upon saving, those additional items are saved to their corresponding table.

ClientResource.php Form
Repeater::make('contacts')
 ->relationship()
 ->schema([])


Client Model
public function contacts() {
    return $this->hasMany(Contact::class);
}


When the client resource creation runs, it creates the client item but doesn't create the contact(s).
Was this page helpful?