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 review model changes before they’re persisted. It stores pending/new or amended data (approve/reject states) so you can build your own approval workflow. Includes migrations and configurable states/tables.

View on GitHub
Deep Wiki
Context7
v2.0.0

Approval v2.0.0

A complete overhaul — every source file reviewed, refactored, and tested to 100% coverage. Built for Laravel 11, 12, and 13.

⚠️ Breaking Changes

Full upgrade guide: UPGRADE.md

  • thenDo(callable) removed — Renamed to thenCustom() with no parameter. The callback was silently discarded in v1. Move custom expiration logic to an ApprovalExpired event listener.
  • ModelRolledBackEvent renamed to ModelRolledBack — Update imports and event listener type-hints.
  • Facade removedCjmellor\Approval\Facades\Approval is gone. Use Cjmellor\Approval\Models\Approval directly.
  • Config keys flattenedconfig('approval.approval.approval_pivot')config('approval.approval_pivot'). Re-publish your config: php artisan vendor:publish --tag="approval-config" --force
  • Event $approval property — Now typed as Approval instead of Model. Update any type-hints in event listeners.
  • pending() scope — Now excludes approvals with custom states set. Use whereState('pending') for the old behaviour.
  • Expiration actions — Now use ExpirationAction enum instead of raw strings. $approval->expiration_action === ExpirationAction::Reject instead of === 'reject'.
  • Mass assignment$guarded = [] replaced with explicit $fillable. Use forceFill() if you were mass-assigning non-standard columns.

✨ New Features

  • ExpirationAction enum — Type-safe expiration actions (Reject, Postpone, Custom)
  • ApprovalEvent base class — All events share typed Approval $approval and ?Authenticatable $user properties
  • ApprovalStatus::values() helper — Derive standard state values from the enum
  • actioned_by tracking — Expired approvals record who processed them
  • Laravel Boost AI skills — Package ships with AI guidelines and two skills:
    • approval-development — Full API reference for AI-assisted development
    • approval-upgrade-v2 — Automated v1→v2 migration runbook

🔧 Improvements

  • 100% test coverage — 74 tests, 208 assertions
  • Events fire after DB writes — No more listeners acting on uncommitted state
  • processExpired() resilience — Chunked queries, per-approval error handling, pending-only filter
  • Duplicate detection scoped to model — Prevents cross-model false positives
  • Null guards — Clear errors when related models are deleted
  • getState() bug fix — No longer returns null for standard states after v2 migration
  • Performance — Removed per-request schema introspection from boot and state updates
  • Defensive codingJSON_THROW_ON_ERROR, class_uses_recursive(), strict in_array(), explicit $fillable
  • Migration rollbacks — All newer migrations include idempotent down() methods

📦 Upgrading

composer require cjmellor/approval:"^2.0"
php artisan vendor:publish --tag="approval-migrations"
php artisan approval:upgrade-to-v2
php artisan migrate
php artisan vendor:publish --tag="approval-config" --force

See UPGRADE.md for the full guide with all breaking changes and before/after examples.

Using Laravel Boost? The approval-upgrade-v2 skill can automatically search your codebase and apply all breaking changes.

What's Changed

Full Changelog: https://github.com/cjmellor/approval/compare/v1.6.6...v2.0.0

v1.6.5

What's Changed

Full Changelog: https://github.com/cjmellor/approval/compare/v1.6.4...v1.6.5

v1.6.3

What's Changed

New Contributors

Full Changelog: https://github.com/cjmellor/approval/compare/v1.6.2...v1.6.3

v1.6.1

What's Changed

Full Changelog: https://github.com/cjmellor/approval/compare/v1.6.0...v1.6.1

v1.6.0

What's Changed

New Contributors

Full Changelog: https://github.com/cjmellor/approval/compare/v1.5.0...v1.6.0

v1.5.0

What's Changed

[!IMPORTANT] This release requires that you're using >= PHP 8.2. If you're not, stick to the previous version.

Full Changelog: https://github.com/cjmellor/approval/compare/v1.4.5...v1.5.0

v1.4.5

What's Changed

New Contributors

Full Changelog: https://github.com/cjmellor/approval/compare/v1.4.4...v1.4.5

v1.4.4
v1.4.3

What's Changed

New Contributors

Full Changelog: https://github.com/cjmellor/approval/compare/v1.4.2...v1.4.3

v1.4.2

What's Changed

New Contributors

Full Changelog: https://github.com/cjmellor/approval/compare/v1.4.1...v1.4.2

v1.4.0

What's Changed

Full Changelog: https://github.com/cjmellor/approval/compare/v1.3.1...v1.4.0

v1.3.1

What's Changed

Full Changelog: https://github.com/cjmellor/approval/compare/v1.3.0...v1.3.1

v1.3.0
v1.2.0

What's Changed

Full Changelog: https://github.com/cjmellor/approval/compare/v1.1.5...v1.2.0

v1.1.5

What's Changed

New Contributors

Full Changelog: https://github.com/cjmellor/approval/compare/v1.1.4...v1.1.5

v1.1.4

What's Changed

Full Changelog: https://github.com/cjmellor/approval/compare/v1.1.3...v1.1.4

v1.1.3

What's Changed

Full Changelog: https://github.com/cjmellor/approval/compare/v1.1.2...v1.1.3

v1.1.2
v1.1.1

What's Changed

Full Changelog: https://github.com/cjmellor/approval/compare/v1.1.0...v1.1.1

v1.1.0

What's Changed

Full Changelog: https://github.com/cjmellor/approval/compare/v1.0.1...v1.1.0

v1.0.1

What's Changed

New Contributors

Full Changelog: https://github.com/cjmellor/approval/compare/v1.0.0...v1.0.1

v1.0.0

Initial release

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4