Weave 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

Approval is a Laravel package that provides a simple way to approve new Model data before it is persisted. Add an approval workflow to any Eloquent model, keeping unapproved changes out of your database until reviewed. Requires PHP 8.3+ and Laravel 12.4+.

View on GitHub
Deep Wiki
Context7
v2.1.0

What's Changed

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

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 removed — Cjmellor\Approval\Facades\Approval is gone. Use Cjmellor\Approval\Models\Approval directly.
  • Config keys flattened — config('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 coding — JSON_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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings