Over the last few months, while working on enterprise Laravel projects, I noticed a recurring "Notification Nightmare."
Every company needs an approval workflow (requisitions, invoices, PTO), but most systems flood managers with separate notifications for every single item.
I decided to build a solution: Laravel Approval Engine.
š„ The "Smart Batching" Concept
The core problem with enterprise workflows isn't the approval logic; it's notification fatigue. Instead of sending 50 separate emails for 50 pending approvals, my engine buffers them into 1 smart batch. The manager receives a single, clean digest with secure, token-based links to approve everything at once.
šļø How it Works
The architecture is designed to be modular and plug-and-play.
- Define a Module: Use
php artisan make:workflow-moduleto create a logic class. - Queue Records: Your business models enter a "pending" state.
- The Processor: A scheduled artisan command bundles pending records into a
Batch. - Action: The approver receives a single email. They can Approve All, Reject, or View Details via a secure Next.js dashboard.
š§ Technical Highlights
-
Multi-stage Workflows: Easily route from
Manager -> Finance -> CEO. - Token-based Security: Approvers don't even need to log in to take action.
- Event-Driven: Hooks for every stage (Created, Approved, Escalated).
- Next.js Dashboard: A sleek frontend for managing the workflow status.
- Laravel 12 Ready: Built to work with the latest PHP 8.2+ features.
š The Workflow Flow
graph TD
A[Pending Records] --> B[Smart Batch Created]
B --> C[Email Digest Sent]
C --> D[Approver Clicks Link]
D --> E[Stage Resolver]
E --> F{Next Stage?}
F -- Yes --> G[Create Next Batch]
F -- No --> H[Workflow Completed]
š Try the Demo
I've included a demo inside the repo so you can see it in action in under 2 minutes:
git clone https://github.com/apurba-labs/laravel-approval-engine
cd laravel-approval-engine/example/laravel-demo
composer install
php artisan approval:demo
š GitHub
Iād love for the community to check it out, give it a star, or suggest new features!
Would love to hear your feedback! How do you handle complex approval routing in your own Laravel apps?
Top comments (0)