teknoo/states-bundle
Teknoo States Bundle is a Symfony bundle for defining and managing object states and transitions. It provides configurable state machines, transition rules, and workflow integration for PHP applications that need clear lifecycle handling.
match($order->status)/if ladders scattered across controllers, jobs, and observers, or to formalize state transitions so behavior lives next to the state it applies to. This is the recurring decision behind any entity that "does different things depending on where it is in its life."teknoo/states-bundle) is a deprecated, archived Symfony bundle (2 stars, 0 dependents). The real product decision is not "adopt this bundle" on a Laravel stack, but "do we want formal state handling at all, and if so with which Laravel-native implementation?" The intended successor is teknoo/states 3.1+, and even that must be validated as maintained.teknoo/states-bundle for new work, and not on Laravel. It is archived and explicitly deprecated in its own description, it is a Symfony bundle (no service provider, publishable config, or facade maps to Laravel), and a modern Laravel composer.json will likely fail resolution against its Symfony-pinned constraints. Two stars and zero dependents mean no community safety net, no security patching, and no upstream fixes.teknoo/states 3.1+) — and only if: you specifically want the State pattern expressed as generated PHP classes, you are comfortable with a codegen-first workflow, your state graph is static and known at design time, and you have confirmed an active release cadence and PHP/Laravel version support. Treat the bundle purely as design documentation.StateHydrator + Eloquent cast, or a mature package such as Spatie's model-states.Executive summary. This specific package is a dead end — it is deprecated by its author, archived, has effectively no users, and is a Symfony bundle that does not fit our Laravel stack. We should not build on it. But the problem it addresses is real and recurring: our lifecycle logic (order status, subscription states, approvals, onboarding) tends to accrete into large conditional blocks that are expensive to change and risky to test, and that logic sits directly in the path of core business behavior.
Recommendation. Treat this as a signal to standardize on a maintained, Laravel-idiomatic workflow approach — backed enums with explicit transition methods or an actively maintained package (e.g., Spatie model-states) as the default. Consider teknoo/states 3.1+ only if the team specifically wants generated state classes and the library proves alive. Do not greenlight the deprecated bundle under any circumstance; at most, harvest it as a design reference.
For engineering. Low effort to evaluate, near-zero migration cost today if we have no internal dependents, and the decision costs a design conversation rather than a build. Run a short timeboxed spike on a throwaway branch — generate or hand-write one real state machine (e.g., the order lifecycle), diff it against a hand-written enum-based equivalent, then choose. Prefer build-time codegen with committed output so the runtime dependency disappears and only the build step is at risk. If emitted classes are committed, document the regeneration command or the next engineer will edit generated code in place. If the bundle already exists in any legacy service, flag it as archived-dependency debt and scope a move to native enums or a maintained package.
Risk framing. Adopting an archived, single-maintainer dependency with 2 stars concentrates risk on a component sitting in the critical path of core business logic — the worst place for an unmaintained library, and one that cannot ship a security fix. The high "opportunity" signal reflects an unoccupied niche, not a healthy dependency; the low overall score correctly identifies why it is unoccupied. The pattern is sound; this artifact is not.
How can I help you explore Laravel packages today?