Approvable
interface Approvable (View source)
Implemented by models that use the RequiresApprovalWhenChanges concern: models whose changes can be captured as a pending Modification instead of being saved directly.
Methods
The modifications recorded for this model.
Carry out a decision on a modification, once enough votes are in. Runs in the vote's transaction.
Details
MorphMany
modifications()
The modifications recorded for this model.
void
applyModificationChanges(Modification $modification, bool $approved)
Carry out a decision on a modification, once enough votes are in. Runs in the vote's transaction.
A class using the RequiresApprovalWhenChanges concern gets this for free. One implementing it
by hand must close the modification: set status to approved or rejected, and save it. If it's
still pending afterwards the decision counts as refused, with no exception: the vote and every
database effect are undone, and approve()/disapprove() return false.