Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
cart-development
realrashid/cart
claude-code
shopping-cart
ecommerce
wishlist
cart-instances
eloquent
vendor-publish
taxes

Build and manage shopping cart functionality including adding items, calculating totals, and managing multiple cart instances.

Install
php artisan boost:add-skill realrashid/cart

Save this content to: .claude/skills/cart-development/SKILL.md

# Cart Development

## When to use this skill

Use this skill when implementing shopping cart features, e-commerce workflows, or wishlist management in Laravel applications using the `realrashid/cart` package.

## Features

- Publish configuration (`vendor:publish` tag: `cart-config`).
- Manage multiple cart instances (e.g., 'main', 'wishlist').
- Add, update, and remove items with custom options and associated models.
- Automatically calculate subtotals, taxes, and totals based on cart contents.

## Examples

### Adding an item to the cart

```php
use RealRashid\Cart\Facades\Cart;

Cart::add('id_1', 'Product 1', 2, 19.99, ['size' => 'L']);
```

### Updating cart item quantity

```php
Cart::update($rowId, 3); // Update quantity to 3
Cart::update($rowId, ['name' => 'New Product Name']); // Update other details
```

### Associating a cart item with an Eloquent model

```php
Cart::associate($rowId, 'App\Models\Product');
$item = Cart::get($rowId);
echo $item->model->name; // Access associated product model
```

### Showing cart contents and totals

```php
$cartItems = Cart::content();
$total = Cart::total();
$tax = Cart::tax();
```

## Implementation tips for AI agents

- Use `Cart::instance('wishlist')` for multiple cart purposes within the same session.
- Leverage model association to avoid manual database lookups when displaying cart items.
- Suggest `php artisan vendor:publish --tag=cart-config` to customize default tax rates and storage settings.

Cart Development

When to use this skill

Use this skill when implementing shopping cart features, e-commerce workflows, or wishlist management in Laravel applications using the realrashid/cart package.

Features

  • Publish configuration (vendor:publish tag: cart-config).
  • Manage multiple cart instances (e.g., 'main', 'wishlist').
  • Add, update, and remove items with custom options and associated models.
  • Automatically calculate subtotals, taxes, and totals based on cart contents.

Examples

Adding an item to the cart

use RealRashid\Cart\Facades\Cart;

Cart::add('id_1', 'Product 1', 2, 19.99, ['size' => 'L']);

Updating cart item quantity

Cart::update($rowId, 3); // Update quantity to 3
Cart::update($rowId, ['name' => 'New Product Name']); // Update other details

Associating a cart item with an Eloquent model

Cart::associate($rowId, 'App\Models\Product');
$item = Cart::get($rowId);
echo $item->model->name; // Access associated product model

Showing cart contents and totals

$cartItems = Cart::content();
$total = Cart::total();
$tax = Cart::tax();

Implementation tips for AI agents

  • Use Cart::instance('wishlist') for multiple cart purposes within the same session.
  • Leverage model association to avoid manual database lookups when displaying cart items.
  • Suggest php artisan vendor:publish --tag=cart-config to customize default tax rates and storage settings.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums