Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Approval Laravel Package

cjmellor/approval

Laravel package to stage and approve new Eloquent model data before it’s persisted. Provides an approval workflow with migrations and configurable behavior, supporting PHP 8.3+ and Laravel 12.4+/13.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Regulatory Compliance & Data Integrity: Enables controlled workflows for sensitive data (e.g., financial records, user-generated content) requiring approval before persistence.
  • Feature Roadmap: Accelerates development of moderation systems (e.g., admin approval for posts, transactions, or legal documents) without building custom approval logic.
  • Build vs. Buy: Eliminates the need to design, test, and maintain a bespoke approval system, reducing technical debt and accelerating time-to-market.
  • Use Cases:
    • Content Moderation: Approve user-submitted posts, articles, or comments before publishing.
    • Financial Systems: Validate transactions or invoices before processing.
    • HR/Compliance: Approve employee records, leave requests, or sensitive updates.
    • Multi-Tier Workflows: Implement staged approvals (e.g., "Pending → In Review → Approved").
    • Expiring Content: Auto-reject or postpone stale approvals (e.g., time-sensitive promotions).

When to Consider This Package

Adopt if:

  • Your Laravel app requires pre-persistence validation for specific models (e.g., user-generated content, financial data).
  • You need audit trails for changes (stores original/new data, timestamps, and approver IDs).
  • Your workflow includes time-based actions (e.g., auto-reject after 48 hours).
  • You want to avoid custom approval logic while maintaining flexibility (e.g., custom states like "Needs Clarification").
  • Your team uses Laravel 12.4+ and PHP 8.3+ (hard dependency).

Look elsewhere if:

  • You need real-time approvals (this package stores data first, then approves).
  • Your approval process requires complex business rules (e.g., multi-level hierarchies with conditional routing).
  • You’re on Laravel <12.4 (requires upgrade or v2.0).
  • You need offline/async approvals (package assumes database persistence).
  • Your use case involves non-model data (e.g., API requests, external systems).

How to Pitch It (Stakeholders)

For Executives: "This package lets us enforce approval workflows for critical data (e.g., user content, transactions) without building custom systems. It reduces risk by requiring manual review for sensitive changes, automates time-based actions (e.g., reject stale requests), and integrates seamlessly with our Laravel stack. For example, we could use it to moderate posts or validate financial entries—saving dev time while improving compliance."

For Engineering: *"Pros:

  • Zero custom code for basic approval workflows: Add a trait to your model, and it handles storage, states, and events.
  • Flexible: Supports custom states, timeouts, and conditional actions (e.g., auto-reject after 24 hours).
  • Audit-ready: Tracks original/new data, approvers, and timestamps in a dedicated approvals table.
  • Scalable: Works for single models or entire domains (e.g., all Post or Invoice models).

Trade-offs:

  • Not real-time: Data is stored first, then approved (may need event listeners for async processing).
  • Laravel 12.4+ only: Requires upgrade if on older versions.
  • Opinionated schema: Uses a polymorphic approvals table (but configurable).

Quick Start:

composer require cjmellor/approval
php artisan vendor:publish --tag="approval-migrations"
php artisan migrate

Then add use MustBeApproved to your model. Done.

Example Use Case:

‘We want admins to approve new blog posts before publishing.’ Add the trait to the Post model. All new posts go to pending state until an admin runs $approval->approve(). The package handles the rest—no custom logic needed."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle