New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

roundly-consulting/approvals-for-laravel

Record polymorphic approvals between Eloquent models for Laravel.
1,023 6
Install
composer require roundly-consulting/approvals-for-laravel
Latest Version:2.2.0
PHP:^8.4
Laravel:13
Older releases:12
License:MIT
Last Updated:Nov 9, 2026
Links: GitHub  ·  Packagist
Maintainer: mihaliak

Approvals for Laravel — Roundly open source

Latest release Tests Code style Donate Patreon Crypto

Approvals for Laravel

Model approvals, rejections, and multi-approver sign-off between Eloquent models. Any model can decide on any other, and a subject can open a request that resolves by unanimous, quorum, any-one or weighted rules — as staged pipelines, with delegation, expiry and an event for every transition.

Installation

Requires PHP 8.4 and Laravel 13.

composer require roundly-consulting/approvals-for-laravel
php artisan vendor:publish --tag="approvals-migrations"
php artisan migrate

If your models have UUID/ULID keys, set APPROVALS_KEY_TYPE=uuid (or ulid) before migrating.

Usage

Give the deciding model and the decided-on model their traits:

use Illuminate\Database\Eloquent\Model;
use RoundlyConsulting\Approvals\Traits\GivesApprovals;
use RoundlyConsulting\Approvals\Traits\HasApprovals;
use RoundlyConsulting\Approvals\Traits\RequiresApproval;

class User extends Model
{
    use GivesApprovals;
}

class Invoice extends Model
{
    use HasApprovals;
    use RequiresApproval;
}

Then open a request that needs two of three named approvers — it resolves as their decisions come in:

use RoundlyConsulting\Approvals\Facades\Approvals;

Approvals::request($invoice)->from([$lead, $qa, $pm])->quorum(2)->open();

Approvals::for($invoice)->as($lead)->approve();
Approvals::status($invoice);                      // ApprovalStatus::Pending — 1 of 2

Approvals::for($invoice)->as($intern)->approve(); // throws UnauthorizedApprovalException: not named

Approvals::for($invoice)->as($qa)->because('Totals check out')->approve();
Approvals::status($invoice);                      // ApprovalStatus::Approved
$invoice->isApproved();                           // true

Documentation

The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/approvals-for-laravel

Release notes are in CHANGELOG.md. To contribute, see the contributing guide.

Support our work

This package is free and open source, built and maintained by Roundly Consulting. If it saves you time, please consider supporting our open-source work — a one-time donation, a monthly pledge on Patreon or a crypto donation helps fund maintenance, new features and new packages.

Donate to Roundly open source Become a patron on Patreon Donate crypto: BTC, ETH, BNB or SOL

License

The MIT License (MIT). Please see LICENSE for more information.

Related Packages

roundly-consulting/enums-for-laravel

Convenient helper methods for PHP enums in Laravel applications

5,230 5
roundly-consulting/testing-for-laravel

Dev-only test machinery for Laravel packages and apps: base test cases, a struct...

5,126 5
ovac/guardrails

Operational approvals engine for Laravel applications.

2,030 4
roundly-consulting/media-library-for-laravel

Native Laravel media library: polymorphic media buckets, multi-disk storage, and...

1,304 7
roundly-consulting/package-toolkit-for-laravel

A native, dependency-free toolkit for building Laravel packages: a fluent packag...

5,866 5

Version History

Version Released PHP Laravel License
2.2.0 ^8.4 ^13.0 MIT
2.1.0 ^8.4 ^13.0 MIT
2.0.0 ^8.4 ^13.0 MIT
1.2.5 ^8.4 ^12.0|^13.0 MIT
1.2.4 ^8.4 ^12.0|^13.0 MIT