Skip to content

Releases: wearepixel/laravel-cart

v3.0.0

13 Jun 05:58
d1169f5

Choose a tag to compare

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 - CartDriver interface and CartManager with built-in SessionDriver, DatabaseDriver, RedisDriver, NullDriver, and MultiDriver implementations - @joelwmale
  • Cart::fake() - swaps the active driver for an in-memory NullDriver and returns a CartFactory for fluent test state seeding - @joelwmale
  • CartFactory - fluent builder for seeding cart state in tests via withItems(), withCondition(), and withCoupon() - @joelwmale
  • Cart assertion methods - assertContains(), assertCount(), assertTotalQuantity(), assertSubTotal(), assertTotal(), assertConditionApplied(), assertEmpty(), assertNotEmpty() - @joelwmale
  • Coupon abstract class - extend to create first-class coupon objects that convert to CartCondition - @joelwmale
  • TaxRule abstract class - extend to create first-class tax rules that convert to CartCondition - @joelwmale
  • ShippingRate abstract class - extend to create first-class shipping rates that convert to CartCondition - @joelwmale
  • Cart::coupon(), Cart::tax(), Cart::shipping() - accept first-class objects or raw CartCondition instances - @joelwmale
  • HasCart trait - Livewire-aware trait with reactive $cartItems, $cartTotal, $cartSubTotal, $cartCount properties and proxy methods - @joelwmale
  • ShareCartWithInertia - static helper for sharing cart state via HandleInertiaRequests::share() - @joelwmale
  • cart:install Artisan command - publishes config and scaffolds app/Cart/ directory structure - @joelwmale
  • cart:make:coupon, cart:make:tax, cart:make:shipping, cart:make:driver Artisan commands - generate typed stub classes - @joelwmale
  • cart:debug Artisan command - dumps current cart state (non-production only) - @joelwmale
  • applies_to support 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

  • Cart constructor now accepts a CartDriver instance instead of raw session/database storage; applications using the service container are unaffected - @joelwmale
  • Config publish tag renamed from config to cart-config to avoid conflicts with other packages - @joelwmale
  • CartSession removed and replaced by the driver system - @joelwmale

Fixed

  • Redis driver TTL units corrected from minutes to seconds - @joelwmale
  • CartFacade @mixin and @method PHPDoc restored for IDE and PHPStan support - @joelwmale
  • Missing return type added to getAssociatedModel - @joelwmale
  • Null-safe json_decode in RedisDriver - @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

13 Jun 04:19
7427ce9

Choose a tag to compare

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 calling clearCartConditions() after clear() 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/checkout from v6.0.2 to v6.0.3 in CI - @app/dependabot
  • Bumped shivammathur/setup-php from 2.37.1 to 2.37.2 in CI - @app/dependabot

Contributors

v2.1.3

29 May 04:27
e61ffae

Choose a tag to compare

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() @method signature on CartFacade to accept array input style and reflect accurate nullable/typed parameter signatures

v2.1.2

29 May 04:12
34626ee

Choose a tag to compare

Patch release improving static analysis support and test infrastructure compatibility.

Fixed

  • Added @mixin and @method PHPDoc annotations to CartFacade to 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

27 May 06:43
05729b7

Choose a tag to compare

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/pint from 1.21.0 to 1.29.1
  • Updated pestphp/pest from 3.x to 4.7.0
  • Switched CI runner from deprecated ubuntu-20.04 to ubuntu-latest

v2.1.0

24 Mar 04:06
6638f81

Choose a tag to compare

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-cart to wearepixel/laravel-cart
  • Renamed PHP namespace from Joelwmale\Cart to Wearepixel\Cart across all source files, tests, and documentation
  • Updated composer require instructions and vendor:publish commands in README to reflect new vendor name
  • Bumped mockery/mockery dev dependency from ^1.6 to ^2.0, dropping the hamcrest/hamcrest-php transitive dependency
  • Fixed event tests to mock Illuminate\Contracts\Events\Dispatcher instead of the concrete Illuminate\Events\Dispatcher
  • Updated minimum PHP platform requirement to >=8.3 in composer.lock

Contributors

No PR authors were identified for this release.

v2.0.0

23 Mar 06:30
6dfd0ce

Choose a tag to compare

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

14 Apr 06:54

Choose a tag to compare

What's Changed

Full Changelog: joelwmale/laravel-cart@1.2.0...1.2.1

1.2.0

25 Feb 06:56
e810eb4

Choose a tag to compare

1.1.0

24 Feb 22:57
2196f58

Choose a tag to compare