Releases: wearepixel/laravel-cart
v3.0.0
Summary
Version 3.0.0 is a major release that introduces a pluggable storage driver system, first-class coupon/tax/shipping objects, a full testing harness, Livewire and Inertia integrations, Artisan generators, and PHPStan static analysis at level 5 with zero errors. Existing code continues to work unchanged - the new features are additive.
Added
- Storage driver system -
CartDriverinterface andCartManagerwith built-inSessionDriver,DatabaseDriver,RedisDriver,NullDriver, andMultiDriverimplementations - @joelwmale Cart::fake()- swaps the active driver for an in-memoryNullDriverand returns aCartFactoryfor fluent test state seeding - @joelwmaleCartFactory- fluent builder for seeding cart state in tests viawithItems(),withCondition(), andwithCoupon()- @joelwmale- Cart assertion methods -
assertContains(),assertCount(),assertTotalQuantity(),assertSubTotal(),assertTotal(),assertConditionApplied(),assertEmpty(),assertNotEmpty()- @joelwmale Couponabstract class - extend to create first-class coupon objects that convert toCartCondition- @joelwmaleTaxRuleabstract class - extend to create first-class tax rules that convert toCartCondition- @joelwmaleShippingRateabstract class - extend to create first-class shipping rates that convert toCartCondition- @joelwmaleCart::coupon(),Cart::tax(),Cart::shipping()- accept first-class objects or rawCartConditioninstances - @joelwmaleHasCarttrait - Livewire-aware trait with reactive$cartItems,$cartTotal,$cartSubTotal,$cartCountproperties and proxy methods - @joelwmaleShareCartWithInertia- static helper for sharing cart state viaHandleInertiaRequests::share()- @joelwmalecart:installArtisan command - publishes config and scaffoldsapp/Cart/directory structure - @joelwmalecart:make:coupon,cart:make:tax,cart:make:shipping,cart:make:driverArtisan commands - generate typed stub classes - @joelwmalecart:debugArtisan command - dumps current cart state (non-production only) - @joelwmaleapplies_tosupport on item conditions - limit a condition to the first N units of a line item - @joelwmale- PHPStan level 5 static analysis with zero errors, run in CI on PHP 8.3 - @joelwmale
- Laravel 13 support - @joelwmale
Changed
Cartconstructor now accepts aCartDriverinstance instead of raw session/database storage; applications using the service container are unaffected - @joelwmale- Config publish tag renamed from
configtocart-configto avoid conflicts with other packages - @joelwmale CartSessionremoved and replaced by the driver system - @joelwmale
Fixed
- Redis driver TTL units corrected from minutes to seconds - @joelwmale
CartFacade@mixinand@methodPHPDoc restored for IDE and PHPStan support - @joelwmale- Missing return type added to
getAssociatedModel- @joelwmale - Null-safe
json_decodeinRedisDriver- @joelwmale - Conditions now serialized to arrays before storage, preventing serialization inconsistencies across drivers - @joelwmale
- Guard against null writes in
SessionDriver::setSessionKey- @joelwmale cart:make:*commands now validate class name input and check for file write failures - @joelwmale
Contributors
v2.1.4
Summary
A targeted bug fix for the database cart driver, preventing a fatal error when clearing cart conditions after calling clear(). Also includes routine CI dependency updates.
Fixed
- Resolved "Call to a member function
save()on array" error thrown when callingclearCartConditions()afterclear()with the database driver.clear()was replacing the session object with a plain array, breaking subsequent method calls on the session. - @joelwmale
Changed
- Bumped
actions/checkoutfrom v6.0.2 to v6.0.3 in CI - @app/dependabot - Bumped
shivammathur/setup-phpfrom 2.37.1 to 2.37.2 in CI - @app/dependabot
Contributors
- @app/dependabot
- @joelwmale
v2.1.3
This patch corrects the PHPDoc @method signature for the add() method on the CartFacade, aligning it with the underlying implementation that accepts both individual parameters and an array-style input.
Fixed
- Corrected
add()@methodsignature onCartFacadeto accept array input style and reflect accurate nullable/typed parameter signatures
v2.1.2
Patch release improving static analysis support and test infrastructure compatibility.
Fixed
- Added
@mixinand@methodPHPDoc annotations toCartFacadeto resolve PHPStan/Larastan type errors when using the facade - @joelwmale
Changed
- Added Laravel 13 to the list of supported versions
- Updated PHPUnit configuration to use the PHPUnit 11.5 schema
- Added a test bootstrap file to suppress PHP 8.4 deprecation notices originating from vendor packages
Contributors
v2.1.1
What's Changed
Security
- Pinned all GitHub Actions to full commit SHAs to prevent supply chain attacks via tag hijacking
Maintenance
- Bumped GitHub Actions (checkout, setup-php, retry) to latest versions
- Updated
laravel/pintfrom 1.21.0 to 1.29.1 - Updated
pestphp/pestfrom 3.x to 4.7.0 - Switched CI runner from deprecated
ubuntu-20.04toubuntu-latest
v2.1.0
Summary
This release migrates the package from the joelwmale namespace and Packagist vendor to wearepixel, reflecting the transfer of ownership to the Pixel organisation. All source files, tests, documentation, and configuration have been updated accordingly.
Changed
- Renamed Packagist package from
joelwmale/laravel-carttowearepixel/laravel-cart - Renamed PHP namespace from
Joelwmale\CarttoWearepixel\Cartacross all source files, tests, and documentation - Updated
composer requireinstructions andvendor:publishcommands in README to reflect new vendor name - Bumped
mockery/mockerydev dependency from^1.6to^2.0, dropping thehamcrest/hamcrest-phptransitive dependency - Fixed event tests to mock
Illuminate\Contracts\Events\Dispatcherinstead of the concreteIlluminate\Events\Dispatcher - Updated minimum PHP platform requirement to
>=8.3incomposer.lock
Contributors
No PR authors were identified for this release.
v2.0.0
Release Notes
This major release drops support for older PHP and Laravel versions, raises the minimum requirements to modern supported releases, and introduces automatic cleanup of malformed cart items.
Added
removeInvalidItems()method that automatically strips cart items missing required fields (id,name,quantity), called on every cart session load
Changed
- Minimum PHP version raised from 8.2 to 8.3
- Laravel framework support updated to ^11.0|^12.0|^13.0 (dropped Laravel 10 support)
- CI test matrix updated to cover PHP 8.3, 8.4, and 8.5
v1.2.1
What's Changed
- Added better session management joelwmale/laravel-cart@4c02310
Full Changelog: joelwmale/laravel-cart@1.2.0...1.2.1
1.2.0
What's Changed
- Database Support by @joelwmale in https://github.com/joelwmale/laravel-cart/pull/2
Full Changelog: joelwmale/laravel-cart@1.1.0...1.2.0
1.1.0
What's Changed
- Laravel 12.x Support by @joelwmale in https://github.com/joelwmale/laravel-cart/pull/1
Full Changelog: joelwmale/laravel-cart@1.0.12...1.1.0