Skip to content

Instance Method

attach(_:on:_:)

Attach a single model by creating a pivot model.
func attach(_ to: To, on database: any Database, _ edit: @Sendable (Through) -> () = { _ in }) -> EventLoopFuture<Void>

Parameters

to

The model to attach through a sibling releationship

database

The database to perform the attachment on.

edit

An optional closure to edit the pivot model before saving it.