Search by

roundly-consulting / requests-for-laravel

mihaliak

Requests from entities with approvals.

Package info

github.com/roundly-consulting/requests-for-laravel

pkg:composer/roundly-consulting/requests-for-laravel

Fund package maintenance!

Patreon

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-10-03 18:14 UTC

This package is auto-updated.

Last update: 2026-10-03 18:36:20 UTC


README

Requests for Laravel — Roundly open source

Latest release Tests Code style Donate Patreon Crypto

Requests for Laravel

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.

Installation

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.

Usage

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

Documentation

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.

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). See LICENSE.md.