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

All events live under RoundlyConsulting\Requests\Events and carry public properties:

EventPayloadFired when
RequestCreatedRequest $requestA request is created.
RequestStatusChangedRequest $requestThe status changes — by a direct decision, reopen, cancel, expire, or the engine resolving the approval request.
ApprovalRecordedRequest $request, Model $actorAn approval is recorded through the facade or ResolveRequest — even when the request stays New.
ApprovalRevokedRequest $request, Model $actorreopen() moves the request back to New — withdrawing the actor’s decision while the round is still open.
RequestRejectedRequest $request, Model $actorA rejection resolves the request to Rejected; the actor is the latest rejecting approver.
RequestCancelledRequest $requestcancel() is called, or the approvals engine resolves the round as cancelled.
RequestExpiredRequest $requestexpire() is called (directly or by requests:expire), or the approvals engine lapses the round.

Listening

use Illuminate\Support\Facades\Event;
use RoundlyConsulting\Requests\Enums\Status;
use RoundlyConsulting\Requests\Events\RequestRejected;
use RoundlyConsulting\Requests\Events\RequestStatusChanged;

Event::listen(function (RequestStatusChanged $event): void {
    if ($event->request->status === Status::Approved) {
        // notify the author, write an audit entry, kick off the payout…
    }
});

Event::listen(function (RequestRejected $event): void {
    $event->request;   // the Request
    $event->actor;     // the approver who rejected it
});

The events fire however the change arrived: a round the approvals engine lapses (its own expiry, Approvals::expire()) expires the request and fires RequestStatusChanged and RequestExpired too, and a round the engine cancels fires RequestStatusChanged and RequestCancelled.

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.