New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

dilab/cart

Shopping Cart Library
2,453 6

Larablocks Analysis

dilab/cart has no release yet to check Laravel compatibility against.

Recommendation checks

Use with care

Use with care: meets 0 of 3 checks.

  • No dated releases
  • 0 downloads a month (needs 10,000)
  • 6 GitHub stars (needs 100)

Data from Packagist and GitHub, checked by Larablocks on Nov 29, 2026.

Install
composer require dilab/cart:dev-master
Last Updated:Jan 31, 2026
Links: GitHub  ·  Packagist
Maintainer: xuding

Cart

Build Status

A Shopping Cart Abstraction

Usage

  • Setup initial state
$event = Event::init($data)
  • Create Cart
$cart = new Cart('xuding@spacebib.com', $event)
  • Create Registration Form
$registration = new Registration($cart->getParticipants());

Cart API

  • Add ticket to cart
$cart->addTicket($event->getCategoryById(1), 1);
  • Get participants
$cart->getParticipants();
  • Get order details
$tickets = $cart->tickets()
$subTotal = $cart->subTotal()
$total = $cart->total()
  • Add product to cart
$cart->addProduct($product)
  • Remove product from cart
$cart->removeProduct($productId, $productVariantId)
  • Get product details
$cart->getProducts()  
  
$cart->countProducts()  
  
$cart->productsSubtotal()
  • Coupon

The cart can only use one coupon, but a coupon can be used for multiple tickets

$cart->getCoupon()
$cart->setCoupon(Coupon $coupon)
$cart->applyCoupon()
$cart->cancelCoupon()
$cart->getDiscount()
$cart->usedCouponQuantity()
  • Get currency
$cart->currency()   

Registration API

  • Render a form
$registration->renderParticipant($trackId);
  • Fill a form
$registration->fillParticipant($trackId, $data);
  • Get errors of a participant form
$registration->getErrors($trackId);
  • Redirect to next page
$registration->redirectTo();

Related Packages

rayjun/laravel-cart

Cart for Laravel Application.

26 4
darryldecode/cart

Laravel 5 Shopping cart

2,063,750 1,400
wearepixel/laravel-cart

A cart implementation for Laravel

203,555 13
offline-agency/laravel-cart

Laravel shopping cart with fiscal support

1,853 2
diegonella/cart

Laravel 5 Shopping cart

1,478 0