- Does lexik/workflow-bundle work with Laravel?
- No. It is a Symfony bundle built on the full-stack kernel: a Bundle subclass, DependencyInjection extensions that load XML/YAML service definitions, compiler passes, and kernel.event_listener tags. Laravel has service providers and a container, but no bundle registry, no ContainerBuilder compiler passes, and no tagged-service discovery, so every extension point this package relies on is absent or semantically different. Composer may install it, but it will not run inside a Laravel application.
- Can I install lexik/workflow-bundle in a Laravel 10 or 11 application?
- Composer will attempt it, but dependency resolution fails. Laravel 10 and 11 require symfony/* components at ^6.0 or ^7.0, while this bundle pins symfony/framework-bundle and symfony/dependency-injection to ~2.3, the PHP 5.3 to 5.6 era. You cannot satisfy both constraint sets in a single dependency tree. The only realistic path in is forking or vendoring the source, at which point you own the maintenance permanently.
- What is lexik/workflow-bundle used for?
- It integrates the Symfony Workflow component into Symfony 2 applications, wiring workflow definitions through dependency injection configuration. It also adds workflow visualization and Doctrine entity state tracking, so the current place in a workflow is stored on and read from Doctrine entities. In practice it was a convenience layer around symfony/workflow for older Symfony projects.
- What should I use instead of lexik/workflow-bundle in Laravel?
- Use symfony/workflow directly. The standalone component is framework-agnostic, actively maintained, and PHP 8.2-compatible; it only needs a Definition, a MarkingStoreInterface, and optionally an EventDispatcherInterface. All three have clean Laravel analogues, so a thin service provider plus an Eloquent-backed marking store gets roughly 90 percent of the value with a supported dependency. It is also the component that obsoleted this bundle in the first place.
- Is lexik/workflow-bundle still maintained?
- No. The repository is archived, which means no security patches, no PHP 8.x fixes, and no response to an upstream CVE in a transitive Symfony 2.x dependency. It has around 126 stars and zero dependents, which is the decisive signal: a package with real utility in the Symfony ecosystem would have dozens to hundreds of dependents. The ecosystem has already routed around it.
- Does lexik/workflow-bundle support PHP 8 and modern Symfony versions?
- No. It targets PHP 5.3 to 5.6 alongside Symfony 2.3, so there are no PHP 8.x compatibility guarantees and no Symfony 6 or 7 support. Laravel 10 and 11 require PHP 8.1+ and Symfony 6/7 components, so the two cannot coexist in one application. Any PHP 8 support would have to come from your own fork.
- How do I persist workflow state to an Eloquent model?
- Use a MethodMarkingStore pointing at a state attribute on your Eloquent model, so getMarking and setMarking read and write a single column. If you need a full transition audit trail, write a custom MarkingStoreInterface implementation backed by a workflow_transitions table. The bundle's Doctrine-centric persistence does not transfer to Eloquent, so you replace that layer rather than reuse it.
- How do I test workflows in a Laravel application?
- Because symfony/workflow is a plain PHP object, you can unit test it without booting Laravel: build a Definition, apply transitions, and assert the marking. For guards, pass the domain subject or a scalar context and assert which transitions are allowed and which are blocked. Feature tests can resolve the workflow from the container and assert the final Eloquent state column afterwards.
- Can I visualize workflow definitions without lexik/workflow-bundle?
- Yes. The bundle's visualization was a wrapper around the workflow's own graph representation. symfony/workflow can dump a definition to Mermaid or Graphviz via WorkflowDumper, which you can render in a dev-only route or an artisan command. Porting the bundle's visualizer is unnecessary.
- What are the trade-offs of forking lexik/workflow-bundle for Laravel?
- Forking is the highest-cost option: you rewrite the DI extension points as service providers, replace Doctrine entity tracking with Eloquent, and modernize Symfony 2.3 constraints for PHP 8. You get zero upstream commits and inherit the maintenance burden indefinitely. Given that symfony/workflow already provides the engine and needs only a small Laravel adapter, a fork is rarely justified unless you need the old visualization code verbatim.