Requests from entities with approvals.
roundly-consulting/requests-for-laravel is a Laravel package for requests from entities with approvals..
It currently has 5 GitHub stars and 15 downloads on Packagist (latest version 1.2.2).
Install it with composer require roundly-consulting/requests-for-laravel.
Discover more Laravel packages by roundly-consulting
or browse all Laravel packages to compare alternatives.
Last updated
Requests that need sign-off — claims, applications, expense or leave requests — submitted by any
Eloquent model and decided by the approvers you name. Approval rules, multi-stage pipelines,
delegation, expiry and a full audit trail run on approvals-for-laravel, while each request keeps
its own status lifecycle and events.
Requires PHP 8.4, Laravel 12 or 13.
composer require roundly-consulting/requests-for-laravel
php artisan vendor:publish --tag="requests-migrations"
php artisan vendor:publish --tag="approvals-migrations"
php artisan migrate
If the models that author requests have UUID/ULID keys, set REQUESTS_KEY_TYPE before
migrating. If your approvers do (APPROVALS_KEY_TYPE), set REQUESTS_PRIMARY_KEY_TYPE to the
same value, also before migrating.
Let the models that author and approve requests use the two traits:
use Illuminate\Database\Eloquent\Model;
use RoundlyConsulting\Approvals\Interfaces\GivesApprovalsInterface;
use RoundlyConsulting\Approvals\Traits\GivesApprovals;
use RoundlyConsulting\Requests\Concerns\HasRequests;
use RoundlyConsulting\Requests\Contracts\HasRequests as HasRequestsContract;
class User extends Model implements GivesApprovalsInterface, HasRequestsContract
{
use GivesApprovals;
use HasRequests;
}
Submit a request that needs sign-off from named approvers:
use RoundlyConsulting\Requests\Facades\Requests;
$request = Requests::make()
->author($user)
->type('Claim')
->title('Expense reimbursement')
->requireApprovalsFrom([$alice, $bob]) // only they, or their delegates, may decide
->expiresAt(now()->addDays(7))
->create();
Then decide it — by default every approver must approve:
Requests::approve($request, $alice); // 1 of 2 — still New
Requests::approve($request, $bob, reason: 'Looks good'); // 2 of 2 — Approved
$request->status; // Status::Approved
$user->approvedRequests()->get(); // the author's approved requests
The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/requests-for-laravel
Release notes are in CHANGELOG.md. To contribute, see the contributing guide.
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.
The MIT License (MIT). See LICENSE.md.