NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages
Requests for Laravel

Inspecting approvals

$alice->hasApproved($request);          // bool
$alice->hasRejected($request);          // bool
$request->isApproved();                 // engine resolved to approved
$request->isPendingApproval();          // still awaiting decisions
$request->currentApprovalStatus();      // ApprovalStatus enum
$request->currentStage();               // open stage of a pipeline, if any
$request->isExpired();                  // open and past its deadline

$progress = $request->approvalProgress();
$progress?->approved;                   // e.g. 2
$progress?->required;                   // e.g. 3
$progress?->percentage();               // 67

isApproved(), isPendingApproval(), currentApprovalStatus(), currentStage() and approvalProgress() read the latest approval request in the engine. A request with no declared approvers has none, so it reports pending and a null progress — read $request->status for the request’s own lifecycle.

The progress snapshot

approvalProgress() returns an ApprovalProgress snapshot, or null when no approval request exists. For pipelines, ratio() and percentage() measure cleared stages:

$progress->status;          // ApprovalStatus — pending, approved, rejected, cancelled, expired
$progress->approved;        // approvals so far
$progress->rejected;        // rejections so far
$progress->required;        // declared approver count
$progress->threshold;       // ?int — the quorum / weight threshold
$progress->currentStage;    // ?int — for pipelines
$progress->totalStages;     // 0 for flat requests
$progress->clearedStages;
$progress->ratio();         // 0.0–1.0
$progress->percentage();    // 0–100

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

By donating, you agree to our donation terms.

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.