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

Maker Checker Laravel Package

moffhub/maker-checker

Feature-complete maker-checker (four-eyes) approvals for Laravel. Add a trait to intercept model create/update/delete, or use the API for complex workflows: multi-level/role & user approvals, conditional rules, delegation, bulk ops, reminders/escalation, audit trail & export.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Four-eyes principle alignment: Perfect fit for regulated environments (finance, HR, compliance) where manual approvals are mandatory.
  • Eloquent integration: Seamless with Laravel’s ORM, leveraging traits for minimal boilerplate.
  • Modular design: Supports both simple (trait-based) and complex (API-driven) workflows, making it adaptable to varying needs.
  • Event-driven: Auto-intercepts Eloquent events (create/update/delete), reducing manual instrumentation.

Integration Feasibility

  • Low friction: Single trait (RequiresApproval) enables approvals for any model with minimal setup.
  • Database-agnostic: Works with Laravel’s default migrations (MySQL/PostgreSQL tested).
  • API-first: REST endpoints for programmatic control, useful for microservices or SPAs.
  • Multi-tenancy: Built-in support for team/company scoping, ideal for SaaS platforms.

Technical Risk

  • Race conditions: Pessimistic locking mitigates double-approval bugs, but requires testing under high concurrency.
  • Complexity: Conditional rules engine and delegation add surface area; requires thorough documentation for teams.
  • User contract dependency: Custom MakerCheckerUserContract implementation is mandatory, adding a small upfront cost.
  • Testing burden: 360+ tests suggest robustness, but edge cases (e.g., bulk operations + delegation) may need validation.

Key Questions

  1. Approval granularity: Does the team need per-model or global approval rules? (Configurable via trait or database.)
  2. Delegation frequency: How often will approvals be delegated? (Expiry logic may need tuning.)
  3. Audit compliance: Are CSV/JSON exports sufficient, or are custom audit trails needed? (Extensible via hooks.)
  4. Performance: Will bulk operations or high-volume models stress the pessimistic locks? (Monitor DB contention.)
  5. Legacy systems: How will this integrate with existing approval workflows (e.g., third-party tools)? (API endpoints provide a bridge.)

Integration Approach

Stack Fit

  • Laravel ecosystem: Native support for Eloquent, Queues, Events, and API resources.
  • PHP 8.1+: Leverages modern features (e.g., named arguments, attributes) for cleaner syntax.
  • Database: Schema-agnostic but optimized for MySQL/PostgreSQL (foreign keys, indexes for performance).
  • Frontend: REST API enables integration with React/Vue or mobile apps; Blade templates for admin panels.

Migration Path

  1. Pilot phase:
    • Start with the RequiresApproval trait on 1–2 low-risk models (e.g., blog posts).
    • Validate auto-interception and approval flows.
  2. API integration:
    • Expose endpoints for approvers (e.g., /api/approvals/{request}) via Laravel Sanctum/Passport.
  3. Gradual rollout:
    • Replace custom approval logic with the package’s features (e.g., conditional rules).
    • Migrate from manual checks (e.g., if ($user->isAdmin())) to role-based approvals.
  4. Legacy support:
    • Use withoutApprovalDo() for admin bypasses or seeders.
    • Wrap existing approval services in ExecutableRequest classes.

Compatibility

  • Laravel versions: Tested with LTS releases (10.x/11.x); check composer.json constraints.
  • Package conflicts: Minimal dependencies (only Laravel core); potential overlap with:
    • Activity log packages: Audit trails may duplicate; configure to use one source.
    • Permission systems: Ensure MakerCheckerUserContract aligns with existing RBAC (e.g., Spatie Permissions).
  • Customization: Override default behavior via:
    • Service providers (MakerCheckerServiceProvider).
    • Event listeners (e.g., Approved, Rejected).
    • Model observers for pre/post-approval logic.

Sequencing

  1. Setup:
    • Publish migrations/config (php artisan vendor:publish).
    • Implement MakerCheckerUserContract on the User model.
  2. Core integration:
    • Add RequiresApproval trait to critical models.
    • Configure approval requirements (roles/users) per model/action.
  3. API layer:
    • Register routes for /approvals, /requests, etc.
    • Secure endpoints with middleware (e.g., auth:sanctum).
  4. Advanced features:
    • Enable delegation, reminders, or conditional rules as needed.
    • Extend with custom ExecutableRequest classes for domain-specific actions.
  5. Monitoring:
    • Set up logs for Approved, Rejected, and Escalated events.
    • Track request expiration and audit trail usage.

Operational Impact

Maintenance

  • Updates: Semantic versioning (follow Laravel’s LTS cycle); backward-compatible migrations.
  • Deprecations: Monitor for removed methods (e.g., if MakerChecker facade changes).
  • Vendor lock-in: Low risk; core logic is trait/API-based with clear extension points.
  • Documentation: README is comprehensive, but internal docs may be needed for:
    • Custom ExecutableRequest implementations.
    • Conditional rule syntax (e.g., if ($payload['amount'] > 50000)).

Support

  • Debugging: Audit trail exports (CSV/JSON) simplify issue resolution.
  • Common issues:
    • Stuck requests: Monitor for expired/delegated approvals; implement cleanup jobs.
    • Permission errors: Validate MakerCheckerUserContract implementations.
    • Race conditions: Test with high concurrency; adjust lock timeouts if needed.
  • Support channels: Limited community (1 star, 0 dependents); rely on:
    • GitHub issues for bugs.
    • Custom Slack/Teams channels for internal knowledge sharing.

Scaling

  • Performance:
    • Pessimistic locks: May impact high-write systems; consider read replicas for audit queries.
    • Bulk operations: Test /api/approvals/bulk under load; optimize payload sizes.
    • Database: Index maker_checker_requests on status, created_at, and team_id.
  • Horizontal scaling:
    • Stateless API layer; database remains the bottleneck.
    • Use Laravel Queues for reminders/escalations to decouple from web requests.
  • Caching:
    • Cache approval role mappings (e.g., user->roles) if frequently queried.
    • Avoid caching request statuses (race conditions).

Failure Modes

Failure Scenario Impact Mitigation
Database lock timeout Approval requests hang Adjust lock_for in config; monitor long-running transactions.
Approver system outage Requests stall Implement escalation paths (e.g., auto-approve after 48h).
Corrupted audit trail Compliance gaps Regularly back up maker_checker_audit_logs.
Role misconfiguration Invalid approvals granted Unit test role-based approvals pre-deployment.
Bulk operation failure Partial approvals Use transactions for atomic bulk updates.

Ramp-Up

  • Developer onboarding:
    • 1–2 days: Learn trait/API basics (e.g., RequiresApproval, MakerChecker facade).
    • 1 week: Implement custom ExecutableRequest classes for domain logic.
    • 2 weeks: Configure conditional rules and delegation workflows.
  • Training materials:
    • Code examples: Highlight use cases (e.g., finance transfers, HR actions).
    • Decision trees: Document when to use traits vs. API vs. ExecutableRequest.
    • Approval flow diagrams: Visualize multi-role/user approval paths.
  • Key metrics for success:
    • Reduction in manual approval checks.
    • Time saved on compliance audits (via audit trail exports).
    • Fewer "forgotten" requests (track escalation/reminder usage).
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope