- How do I install offline-agency/oa-laravel-cart in a Laravel application?
- Install it with Composer using composer require offline-agency/oa-laravel-cart, then publish any config or migration files documented in the repository README and run php artisan migrate. Because the package persists carts through Eloquent, review the published migration against your existing schema before running it on a shared database. After installation, add a product to a cart and assert the resulting totals in a quick test to confirm the package is wired up correctly.
- Which Laravel and PHP versions does oa-laravel-cart 4.1 support?
- The package is Laravel-native and follows the 4.x release line, with 4.1.0 shipped as a minor bump. Exact PHP and Laravel constraints are declared in the package composer.json, so check that file and the README support matrix before pinning. If you are on an older Laravel version, verify compatibility in a staging branch rather than assuming the constraint covers you.
- What does the fiscal support in oa-laravel-cart actually do?
- The package is described as a simple cart implementation with fiscal support, meaning cart totals can carry fiscal or tax-related data alongside line items and quantities. Fiscal rules vary heavily by jurisdiction, so read the source and documentation to see exactly which calculations are provided and which are left to your application. Treat the package as a foundation and validate any tax output against your local accounting requirements.
- Which cart operations are atomic in version 4.1.0?
- Release 4.1.0 makes cart mutations atomic, which implies multi-step cart operations such as add, update, and remove are wrapped in database transactions. The release notes do not enumerate every wrapped method, so review the changelog and diff to confirm which operations changed. This matters most if you perform nested writes or fire side effects during a cart mutation, since those now execute inside a transaction boundary.
- How does guest cart transfer work when a user logs in?
- Guest transfer is an opt-in capability added in 4.1.0 that bridges an anonymous session cart to an authenticated user cart. Because it is disabled by default, you can install the release and keep existing behaviour until you explicitly enable it in configuration. Test the case where the authenticated user already has a populated cart, since merge conflict handling and cleanup of the transferred guest cart should be confirmed against the source before enabling it in production.
- Are cart events and listeners dispatched inside the database transaction?
- The 4.1.0 release makes mutations atomic but does not document explicitly whether events fire before or after commit, so inspect the package code and test it in your own app. If listeners now run inside a transaction, queued jobs or nested writes may be affected by a rollback that previously would not have touched them. Audit observers, listeners, and dispatched jobs triggered by cart changes, and add a regression test for the rollback path.
- Does oa-laravel-cart work with multiple auth guards or token-based APIs?
- The package fits standard Laravel applications that use Eloquent, database sessions, and Laravel's built-in auth guards. Teams that rely on multiple guards, API tokens, or headless cart endpoints should verify how guest transfer resolves the current user across guard boundaries. Confirm the behaviour in staging with the same guard and session driver configuration you run in production.
- Which database engines are supported, and are there deadlock or lock timeout concerns?
- Atomic mutations are database-centric, so behaviour depends on your engine and transaction isolation level rather than on the package alone. Validate against the database you use in production, especially if your test suite runs on SQLite while production runs MySQL or PostgreSQL. Long-running cart operations may hold locks longer under 4.1.0, so load-test concurrent cart updates and watch for deadlocks or lock timeouts.
- How should I test cart mutations and guest transfer in my Laravel test suite?
- Run your existing cart and checkout regression tests first, then add targeted tests for mutation rollback, event and listener behaviour, and guest-to-user transfer. Use Laravel's database refreshing traits and simulate a failing operation mid-mutation to confirm nothing partial is persisted. If your tests use SQLite, add at least one integration check on your production database engine, because transaction and locking semantics differ.
- Is oa-laravel-cart actively maintained, and how do I upgrade from 4.0 to 4.1.0?
- Ongoing maintenance is described as low effort as long as the package stays actively released, with 4.1.0 being a minor, backwards-compatible bump. Update via Composer to ^4.1 in a staging branch, review the changelog and diff for new config keys, migrations, or published assets, then run your full test suite. Enable guest transfer behind a feature flag or config toggle, monitor transfer outcomes, and only then promote to production.