Classes
Registers the config and migrations of the package.
Applied to the model that casts approvals/disapprovals on a Modification (e.g. your User model).
Optional: apply to a Modification subclass (which must also implement
Spatie\MediaLibrary\HasMedia and use InteractsWithMedia) to allow
attaching images to a pending change. Requires spatie/laravel-medialibrary,
which this package does not depend on directly.
Applied to the model whose changes should go through an approval workflow.
Implemented by models that use the RequiresApprovalWhenChanges concern: models whose changes can be captured as a pending Modification instead of being saved directly.
Implemented by models that use the ApprovesChanges concern: models that can cast an approval/disapproval on a pending Modification.
Implemented by models whose creation can need approval. They also use the RequiresApprovalWhenChanges concern, which handles the two available modes:
One approver's vote for a modification or one of its items.
One disapprover's vote against a modification or one of its items.
A change to a model: an audit row if it was saved directly, or a request if it's waiting for approval.
A single decidable unit inside a Modification, used only when a model opts into per-field/per-group approval via approvableItemGroups(). A Modification with no items is decided as a whole (legacy behavior).
Hides rows waiting for their creation to be approved on models in draft mode.
Resolves the model classes to use for modifications/approvals/disapprovals,
honoring the approvals.models.* config so consuming apps can swap in
their own subclasses without forking the package.
Undoes a whole decision from inside its transaction when one of its items couldn't be applied, so approve() can't leave a modification half decided. Never reaches the caller.