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
v2.1.0

Breaking Changes

  • Dropped support for Laravel 11 β€” Laravel 11 reached end-of-life on March 12, 2026 and no longer receives security updates. The package now requires illuminate/contracts: ^12.4|^13.0. Users on Laravel 11 should remain on ^2.0 or upgrade their application.
  • Minimum Laravel 12 version is 12.4 β€” Required for the #[Scope] attribute, which was introduced in Laravel 12.4.

Improvements

  • #[Scope] attribute β€” The requestedBy query scope on Approval has been migrated from the scope* method-name convention to Laravel 12.4's #[Illuminate\Database\Eloquent\Attributes\Scope] attribute. Calling Approval::requestedBy($user) continues to work identically.
v2.0.0

Breaking Changes

  • thenDo() renamed to thenCustom() β€” The callback parameter was removed (it was silently discarded). Use an ApprovalExpired event listener for custom expiration logic.
  • ModelRolledBackEvent renamed to ModelRolledBack β€” Consistent naming with all other event classes.
  • Facade removed β€” Cjmellor\Approval\Facades\Approval has been removed. Use Cjmellor\Approval\Models\Approval directly.
  • Config keys flattened β€” config('approval.approval.approval_pivot') is now config('approval.approval_pivot'). Re-publish your config file.
  • Event $approval property typed as Approval β€” Previously typed as Illuminate\Database\Eloquent\Model, now typed as Cjmellor\Approval\Models\Approval.
  • pending() scope excludes custom states β€” If you use configurable states, Approval::pending() now only returns genuinely pending approvals (not those with a custom state set). Use whereState('pending') for the old behaviour.
  • Expiration actions use ExpirationAction enum β€” The expiration_action column is now cast to Cjmellor\Approval\Enums\ExpirationAction.

New Features

  • ExpirationAction enum β€” Type-safe expiration actions (Reject, Postpone, Custom) replacing raw strings.
  • ApprovalEvent base class β€” All events now extend a shared abstract class with typed Approval $approval and ?Authenticatable $user properties.
  • ApprovalStatus::values() helper β€” Returns all standard state values as an array.
  • actioned_by tracking β€” Expired approvals now record who/what processed them.

Improvements

  • 100% test coverage β€” 74 tests, 208 assertions covering every line.
  • Events fire after DB writes β€” State change events now dispatch only after the database update succeeds, preventing listeners from acting on uncommitted state.
  • processExpired() resilience β€” Uses chunkById() for bounded memory, per-approval error handling with report(), and filters to pending-only approvals.
  • Duplicate detection scoped to model β€” approvalModelExists() now filters by approvalable_type and approvalable_id, preventing cross-model false positives.
  • Null guards on rollback() and approve() β€” Clear error messages when the related model has been deleted.
  • getState() null safety β€” Fixed a bug where getState() returned null instead of the standard state value after the v2 migration.
  • callCastAttribute uses getCasts() β€” Supports both property and method-based cast definitions (Laravel 11+).
  • class_uses_recursive() β€” Factory trait now detects MustBeApproved on parent classes.
  • json_decode with JSON_THROW_ON_ERROR β€” Malformed JSON now fails loudly instead of silently becoming null.
  • Schema introspection removed from boot β€” No more per-request Schema::hasTable()/Schema::hasColumn() queries.
  • Explicit $fillable β€” Replaced $guarded = [] with an explicit list of mass-assignable columns.
  • Migration down() methods β€” All newer migrations now include idempotent rollback methods.
  • Laravel 13 support β€” Requires illuminate/contracts ^11.0|^12.0|^13.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

0.0.1
  • 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.
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