model.relation.attach

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.attach', function (string $relationName, array $ids, array $attributes) use (\October\Rain\Database\Model $model) {
    foreach ($ids as $id) {
        traceLog("New relation {$relationName} was created", $id);
    }
});