- Is sylius/cart-bundle compatible with Laravel?
- No. sylius/cart-bundle is a Symfony bundle, not a Laravel package, and it depends on Symfony's DI container, EventDispatcher, Doctrine ORM, Form component, and Sylius Order and Resource abstractions. Laravel has no bundle system, and its container, Eloquent, HTTP kernel, and Blade stack provide no mapping to those extension points. Treat it as a reference architecture for a cart bounded context, not a dependency for a Laravel application.
- Can I install sylius/cart-bundle in a Laravel app with Composer?
- Composer may resolve the package, but installation is not integration. There is no service provider, no config publishing, no facade, and no Artisan surface, and the bundle's Symfony 2, 4, and 5-era constraints will collide with the shared Symfony components in Laravel 10 and 11. Expect dependency conflict resolution work and likely a hard stop.
- Why is sylius/cart-bundle archived, and should I use it?
- The repository is archived, its own description redirects to Sylius/Sylius, and the functionality now lives in Sylius.Component.Order. There is no maintained release line, no security process, and zero dependents, so there is no community validation to lean on. For a Laravel app, do not use it; read the source only to extract schema, resolver, and pipeline patterns.
- What should Laravel developers use instead of Sylius CartBundle?
- Use a Laravel-native cart package or build a small Eloquent-backed cart domain. The portable ideas are Cart and CartItem models, a session- or user-scoped cart provider, item resolvers that normalize submitted data into a line, and a cart-operation pipeline expressed with Laravel Pipeline and events. Store prices in integer minor units and add a unique constraint on cart_id, buyable_type, and buyable_id.
- How do I port Sylius CartBundle cart concepts to Laravel Eloquent?
- Start from the schema, not the package: carts, cart_items, a morphs buyable relation, integer minor-unit prices, and indexed session and user keys for cart resolution. Map Doctrine XML mappings to Eloquent models and Symfony event subscribers to Laravel listeners or queued jobs. Represent totals recalculation as a pipeline of adjustments rather than copying Sylius's full promotions and state machine unless you actually need them.
- Does sylius/cart-bundle support Laravel 10 or 11?
- No. The bundle targets Symfony 2, 4, and 5-era components, and those constraints will conflict with the shared Symfony components bundled with Laravel 10 and 11. There is no Laravel service provider, no published config, and no compatibility guarantees. Laravel version support is simply not part of the package's scope.
- How do I handle cart item resolution and totals calculation in Laravel without Sylius?
- Implement an item resolver that maps submitted data, such as a product ID and quantity, to a cart line, then let a totals pipeline recalculate the cart after every add, update, or remove. In Laravel, bind the cart provider as a scoped singleton, dispatch cart events, and keep recalculation in a dedicated service rather than controllers. Use integer minor units for money to avoid floating-point errors.
- Can I run Sylius CartBundle as a separate Symfony service next to Laravel?
- Only by treating Sylius as a separate Symfony application behind an HTTP API, with Laravel as an API client. Do not vendor the bundle inside the Laravel app or try to share its container and Doctrine mappings. That is an architectural commitment, not a lightweight integration, and the archived bundle should be replaced by the Sylius/Sylius monorepo and its Shop API if Sylius is strategically required.
- What are the security and maintenance risks of using sylius/cart-bundle?
- The package is archived, so there are no security patches, no PHP or framework compatibility guarantees, and no upstream recourse when you find a defect. Its transitive dependency graph includes Doctrine and Symfony components that contend with Illuminate's shared Symfony constraints. Any bug becomes yours to own permanently, which is a governance risk, not just a technical one.
- How should I test a Laravel cart inspired by Sylius CartBundle?
- Test the domain services, not the Symfony bundle: cart creation, add, update, and remove operations, item resolution, and totals recalculation should each have focused unit tests. Use feature tests against your Laravel routes and database constraints, including the unique cart_id, buyable_type, and buyable_id index and integer price storage. If you keep a pipeline, test each adjustment stage independently and assert the final totals.