Skip to the content.

API Reference

← Home

Extension points

Public methods

On a model using RequiresApprovalWhenChanges:

Method Purpose
requiresApproval(callable $callback) Gate this save with an ad-hoc callback instead of requiresApprovalWhenTrait().
noSaveModifications() Skip recording an audit Modification for a direct save.
withModificationMeta($meta) Attach meta to the next Modification produced by this save.
withFullSaveModification() / withFullSaveOnlyUpdateModification() Record the full attribute set instead of just the dirty diff.
forceModification() Force an audit Modification even when the diff is empty.
withOperationId(?string $id) Tag the next Modification(s) with a shared operation_id.
recordModification(...) See Recording Manual Events.
getLastModification() The Modification created by the most recent save.

On a model using ApprovesChanges:

Method Purpose
approve(Modification $m, ?string $reason = null) Decide the whole modification, or every pending item if it has any.
disapprove(Modification $m, ?string $reason = null) Same, rejecting.
approveItem(ModificationItem $i, ?string $reason = null) Decide a single item without touching the others.
disapproveItem(ModificationItem $i, ?string $reason = null) Same, rejecting.

Known limitations

Deprecations

Credits

Next: Upgrading.