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

Doctrine State Machine Laravel Package

kphoen/doctrine-state-machine

Bridges Symfony's StateMachine component with Doctrine ORM, letting entity state transitions be validated and applied automatically during persistence. Configure a state machine for an entity and Doctrine listeners enforce allowed transitions, keeping workflow state consistent and domain models clea...

View on GitHub
Deep Wiki
Context7

Technical Evaluation

  • Architecture fit: Poor for a conventional Laravel application. The package is a Doctrine2 entity behavior, not an Eloquent package. It embeds finite-state-machine behavior into Doctrine entities via event listeners and metadata. Laravel’s default ORM is Eloquent, so adoption would require adding Doctrine ORM to Laravel through a third-party bridge such as laravel-doctrine/orm, which is non-standard and increases architectural complexity. It fits only if the application already uses Doctrine entities and wants state transitions tightly coupled to entity persistence.
  • Integration feasibility: Low for new projects. The package is explicitly deprecated, last released in 2015, and has zero dependents. Its Composer constraints almost certainly target PHP 5.x and Doctrine ORM 2.4-era APIs. Modern Laravel versions require PHP 8.1+ and current Doctrine versions, so installation will likely fail without forking and upgrading. There is no Laravel service provider, no configuration for Laravel, and no modern documentation.
  • Technical risk: High. Unmaintained code carries compatibility, security, and support risk. Doctrine annotations were deprecated in favor of attributes, and the package likely relies on annotation metadata. Event-listener behavior is implicit, which makes debugging and testing harder. Because the project is deprecated and has no dependents, there is little community validation or evidence of production use.
  • Key questions:
    • Does the application actually use Doctrine ORM, or is this being considered for a standard Eloquent-based Laravel app?
    • Is a finite state machine a core domain requirement, or could simpler status fields and guarded transitions suffice?
    • Are there legacy entities already using this package that must be preserved?
    • What is the cost to fork and modernize the package versus replacing it with a maintained workflow library?
    • Which PHP, Doctrine ORM, and Laravel versions must be supported?
    • Are audit trails, transition authorization, and state persistence required?
    • Can the team accept a deprecated dependency, or is a supported alternative mandatory?

Integration Approach

  • Stack fit: Weak for Laravel/Eloquent. If the project must stay on Eloquent, use a Laravel-native state package such as spatie/laravel-model-states or implement explicit transition services. If the project already uses Doctrine, prefer a maintained workflow component such as Symfony Workflow rather than this deprecated behavior. The package should not be added to a new Laravel codebase.
  • Migration path: For a legacy app already using the package, wrap state transitions behind an application-level interface, add characterization tests around current behavior, and replace the implementation incrementally. For new adoption, do not install it; select a maintained alternative. If business constraints force reuse, fork the repository, update Composer constraints for PHP 8.x and current Doctrine ORM, replace annotation handling with attributes or explicit configuration, and add CI. Existing state columns can usually remain; transition logic can be delegated to a modern workflow library through an adapter.
  • Compatibility: Expect incompatibility with modern Laravel. Verify Composer requirements first. The package likely requires old PHP and Doctrine versions, may rely on Doctrine annotations, and has no Laravel integration. A fork would need compatibility work for PHP 8.1+, Doctrine ORM 2.14+ or 3.x, and modern autoloading. Doctrine event listeners and metadata drivers must be registered manually in a Laravel-Doctrine setup.
  • Sequencing:
    1. Confirm whether Doctrine ORM is already in use; if not, stop and choose an Eloquent-native approach.
    2. Document required states, transitions, guards, and audit requirements.
    3. Evaluate maintained alternatives such as Symfony Workflow or Laravel state packages.
    4. If legacy usage exists, write tests that capture current transition behavior before changing anything.
    5. Fork or wrap the package only if replacement is infeasible.
    6. Modernize dependencies and add CI in the fork.
    7. Replace the package behind an interface, then remove it from the dependency graph.

Operational Impact

  • Maintenance: High. The package is unmaintained and deprecated. Any use requires internal ownership, including PHP/Doctrine upgrades, security review, and bug fixes. With only 14 stars and zero dependents, there is minimal community support to rely on.
  • Support: Effectively none. There is no active maintainer, no modern documentation, and no vendor support. The team must rely on internal Doctrine expertise. The deprecated label should be treated as a hard warning for new adoption.
  • Scaling: The runtime overhead of Doctrine event listeners is likely small, but the design scales poorly for teams. State machine behavior embedded in entity metadata is implicit, harder to test, and harder to reason about as the domain grows. Onboarding and code review costs increase. The package itself is unlikely to be a performance bottleneck, but it becomes a maintainability bottleneck.
  • Failure modes: Composer dependency resolution failures on modern PHP; Doctrine event-listener incompatibilities; annotation/attribute parsing errors; silent transition failures; invalid state changes if guards are incomplete; difficulty debugging because behavior is injected through metadata; upgrade dead-ends; and potential security exposure from outdated transitive dependencies.
  • Ramp-up: High for Laravel developers who are not familiar with Doctrine. The state machine concept is simple, but this package’s Doctrine behavior integration is niche. New team members must learn Doctrine metadata, event listeners, and the package’s implicit conventions. Because the package is deprecated, ramp-up also includes explaining why a legacy dependency remains and what the replacement plan is.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource