model.relation.afterAttach

Triggered in October\Rain\Database\Relations\BelongsToMany.

Called after creating a new relation between models (only for BelongsToMany relation)

Example usage:

$model->bindEvent('model.relation.afterAttach', function (string $relationName, array $attachedIdList, array $insertData) use (\October\Rain\Database\Model $model) {
    traceLog("New relation {$relationName} was created", $attachedIdList);
});