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

Finite Laravel Package

yohang/finite

yohang/finite is a lightweight PHP finite state machine library for modeling workflows and state transitions. Define states, transitions, guards, and callbacks with a fluent API, and use it in Laravel or any PHP application.

Deep Wiki
Context7

Product Decisions This Supports

  • Feature scoping: Use yohang/finite when a feature has explicit, bounded lifecycle states—order status, payment state, subscription lifecycle, onboarding progress, approval status, ticket workflow—and the product risk is invalid or skipped transitions.
  • Roadmap sequencing: Treat it as a low-cost enabler for a first version of stateful workflows. Ship the state model and transition rules now; defer workflow-admin UI, SLA engines, and cross-service orchestration until validated.
  • Build vs. buy: Prefer this over hand-rolled if/else status checks or ad hoc enum transition methods when multiple teams need shared transition rules. Prefer it over a full BPM/workflow platform when the domain is simple, single-application, and developer-owned.
  • Laravel integration decisions: Since this is a framework-agnostic PHP finite state machine, plan the Laravel-specific work: service-container binding, persistence mapping, authorization checks, events/listeners, and audit logging. Do not assume Laravel-native conventions or built-in Eloquent integration.
  • Use cases to prioritize: Bounded, deterministic state machines with a known set of states and transitions. Good candidates: checkout/payment states, fulfillment states, subscription cancellation flows, KYC/approval states, content moderation states.
  • Use cases to avoid in product planning: Long-running human workflows, visual workflow builders, distributed sagas, complex parallel state machines, durable timers, or business-user-editable process definitions. Those require a workflow engine or platform, not a simple FSM library.

When to Consider This Package

  • Consider it when the workflow is small to medium, states and transitions are known upfront, and the main need is enforcing legal transitions in PHP/Laravel code.
  • Consider it when engineering wants a lightweight, MIT-licensed library with a simple mental model rather than adopting a heavyweight workflow platform.
  • Consider it when you can own the surrounding product infrastructure: persistence of current state, transition history/audit, authorization, notifications, and admin/ops tooling.
  • Consider it when the team values explicit state/transition definitions that are testable in isolation and can be shared across services or modules in the same PHP codebase.
  • Look elsewhere when business users need to design or change workflows without deployment.
  • Look elsewhere when you need built-in persistence, UI, SLA timers, retries, compensation, parallel branches, or distributed orchestration.
  • Look elsewhere when the product requires a Laravel-native package with first-class Eloquent model state integration, queues, events, and conventions maintained by the vendor.
  • Look elsewhere when compliance requires vendor-supported workflow auditing, versioned process definitions, or enterprise support. The MIT license and community-star signal are useful, but they are not a substitute for a support contract.

How to Pitch It (Stakeholders)

  • Executive summary: yohang/finite is a small MIT-licensed PHP finite state machine that can reduce invalid workflow transitions in Laravel/PHP products at low licensing cost. It is best positioned as an implementation library for well-bounded status flows, not as a complete workflow platform.
  • Product value: It helps teams encode “what states exist and which transitions are allowed” once, instead of scattering status checks across controllers, jobs, and UI code. That improves consistency, testability, and auditability for common product flows.
  • Engineering summary: Adopt it for simple, deterministic state machines where we control persistence, authorization, events, and history. Budget integration work for Laravel conventions and operational tooling; do not expect BPMN, admin UI, durable timers, or distributed orchestration.
  • Decision framing: Choose this when the workflow is developer-owned and bounded. Choose a workflow/BPM platform when the workflow is business-user-editable, long-running, cross-service, or compliance-heavy.
  • Success measures: Fewer invalid transition defects, reduced status-handling code duplication, faster delivery of stateful features, and clear audit trails for state changes. Validate these before expanding into more complex orchestration needs.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
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