interface Approver (View source)

Implemented by models that use the ApprovesChanges concern: models that can cast an approval/disapproval on a pending Modification.

Methods

bool
approve(Modification $modification, string|null $reason = null)

Vote to approve a modification.

bool
disapprove(Modification $modification, string|null $reason = null)

Vote to reject a modification.

MorphMany
approvals()

The approvals cast by this model.

MorphMany
disapprovals()

The disapprovals cast by this model.

Details

bool approve(Modification $modification, string|null $reason = null)

Vote to approve a modification.

Parameters

Modification $modification
string|null $reason

Return Value

bool

False when the vote wasn't taken or the change couldn't be applied.

bool disapprove(Modification $modification, string|null $reason = null)

Vote to reject a modification.

Parameters

Modification $modification
string|null $reason

Return Value

bool

False when the vote wasn't taken or the rejection couldn't be applied.

MorphMany approvals()

The approvals cast by this model.

Return Value

MorphMany

MorphMany disapprovals()

The disapprovals cast by this model.

Return Value

MorphMany