Approval
Overview
The Approval service configures and checks polymorphic approval workflows. Any model can require approval from specific roles or users before proceeding — used by hiring pipelines, contract changes, and leave requests.
Key Methods
| Method | Description |
|---|---|
configure(model, isRequired, approverType, approverName, guardName, minimumApprovals) | Set or update approval config for a model |
remove(model) | Remove approval config |
getFor(model) | Get single approval config |
getAllFor(model) | Get all approval configs for a model |
isRequired(model) | Check if model requires approval |
canApprove(model, user) | Check if a user is authorized to approve |
getAvailableRoles(guardName) | Get all roles for approver selection |
Approver Types
| Type | Description |
|---|---|
role | Any user with the specified Spatie Role can approve |
user | Only the specified user can approve |
Key Files
app/Services/Approval/ApprovalService.php