---
title: "Enums — Approvals for Laravel | Roundly"
description: "ApprovalStatus and ApprovalRule — domain helpers, labels, select options and validation rules that stay in sync with the cases."
url: https://roundly-consulting.com/open-source/docs/approvals-for-laravel/enums
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Approvals for Laravel](https://roundly-consulting.com/open-source/docs/approvals-for-laravel.md)

# Enums

Both enums are string-backed:

| Enum | Cases (value) |
| --- | --- |
| `ApprovalStatus` | Pending (pending), Approved (approved), Rejected (rejected), Cancelled (cancelled), Expired (expired) |
| `ApprovalRule` | Unanimous (unanimous), Quorum (quorum), Any (any), Weighted (weighted) |

## Domain methods

```php
use RoundlyConsulting\Approvals\Enums\ApprovalRule;
use RoundlyConsulting\Approvals\Enums\ApprovalStatus;

ApprovalStatus::Pending->isPending();     // true
ApprovalStatus::Rejected->isDecided();    // true — approved or rejected
ApprovalStatus::Cancelled->isFinal();     // true — anything but pending
ApprovalStatus::Rejected->isLive();       // true — pending, approved or rejected: still the actor's live decision
ApprovalStatus::Approved->canTransitionTo(ApprovalStatus::Cancelled);   // true

ApprovalRule::Quorum->isWeighted();       // true — Quorum and Weighted resolve on summed weight
ApprovalRule::Any->isWeighted();          // false
```

## Labels, options and validation

Both enums use the shared Helpers trait from enums-for-laravel, so they expose the full helper surface on top of their domain methods — with no lang file to maintain:

```php
ApprovalStatus::values()->all();   // ['pending', 'approved', 'rejected', 'cancelled', 'expired']
ApprovalStatus::labels()->all();   // ['Pending', 'Approved', 'Rejected', 'Cancelled', 'Expired']
ApprovalStatus::options();         // Collection of {value, label, name} option DTOs for selects
ApprovalStatus::validationRule();  // 'in:pending,approved,rejected,cancelled,expired'
ApprovalStatus::tryFromName('Approved');   // ApprovalStatus::Approved

ApprovalStatus::Approved->readable();      // 'Approved' (translated, headline-cased)
ApprovalStatus::Approved->isIn([ApprovalStatus::Approved, ApprovalStatus::Rejected]);   // true

ApprovalRule::options();              // a ready-made rule picker
ApprovalRule::validationRule();       // 'in:unanimous,quorum,any,weighted'
ApprovalRule::Weighted->readable();   // 'Weighted'
```

Drop validationRule() straight into request rules and options() into a select or a JSON payload — both stay in sync with the cases automatically:

```php
$request->validate([
    'status' => ['required', ApprovalStatus::validationRule()],
    'rule' => ['required', ApprovalRule::validationRule()],
]);
```

Also available: names(), toOptions(), toArray(), collect(), count(), random(), fromName(), fromLabel() / tryFromLabel(), hasName() / hasValue(), label(), is() / isNot() / isNotIn() and the whenIs…() callbacks.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/approvals-for-laravel.md)
