定制 aiarmada/filament-cart 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aiarmada/filament-cart

Composer 安装命令:

composer require aiarmada/filament-cart

包简介

A comprehensive Filament admin interface for managing shopping carts created by the AIArmada Cart package

README 文档

README

Filament admin panel integration for aiarmada/cart. Provides normalized cart data resources, condition management, and real-time synchronization for high-volume commerce operations.

Requirements

  • PHP 8.4+
  • Laravel 13+
  • Filament 5+
  • aiarmada/cart

Installation

composer require aiarmada/filament-cart

Register the plugin in your Filament panel provider:

use AIArmada\FilamentCart\FilamentCartPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentCartPlugin::make(),
        ]);
}

Publish the configuration (optional):

php artisan vendor:publish --tag="filament-cart-config"

Resources

The plugin registers four Filament resources under the E-Commerce navigation group:

Resource Model Purpose
Carts Cart View normalized cart snapshots
Cart Items CartItem Browse individual line items
Cart Conditions CartCondition View conditions applied to carts
Conditions Condition Manage reusable condition templates

Cart Resource

Read-only resource displaying cart snapshots with:

  • Instance filtering (default, wishlist, quote, layaway)
  • Item and condition counts
  • Subtotal and total calculations
  • Metadata search

Cart Item Resource

Read-only resource for line item analysis:

  • Price and quantity filters
  • Attribute inspection
  • Parent cart navigation
  • JSON-searchable metadata

Cart Condition Resource

Read-only resource showing applied conditions:

  • Type badges (discount, fee, tax, shipping)
  • Target visualization (subtotal, total, item)
  • Value display (percentage or fixed)
  • Calculation order

Condition Resource

Full CRUD for reusable condition templates:

  • Create discount, tax, fee, and shipping conditions
  • Configure dynamic rules with factory keys
  • Set global auto-apply behavior
  • Manage condition ordering

Widget

The CartStatsWidget displays key metrics on your dashboard:

  • Active cart count
  • Total cart items
  • Total cart value

Configuration

// config/filament-cart.php

return [
    'navigation_group' => 'E-Commerce',
    'polling_interval' => 30,
    'enable_global_conditions' => true,
    'dynamic_rules_factory' => \AIArmada\Cart\Services\BuiltInRulesFactory::class,
    
    'synchronization' => [
        'queue_sync' => false,
        'queue_connection' => 'default',
        'queue_name' => 'cart-sync',
    ],
];

Event Synchronization

The plugin automatically syncs cart state via event listeners:

  • SyncCartOnEvent — Creates/updates normalized records
  • ApplyGlobalConditions — Auto-applies global conditions
  • CleanupSnapshotOnCartMerged — Handles cart merge cleanup

Dynamic Conditions

Create conditions with rule-based application:

use AIArmada\Cart\Models\Condition;

Condition::create([
    'name' => 'bulk_discount',
    'display_name' => '10% Bulk Discount',
    'type' => 'discount',
    'target' => 'cart@cart_subtotal/aggregate',
    'value' => '-10%',
    'rules' => [
        'factory_keys' => ['min-items', 'total-at-least'],
        'context' => ['min' => 3, 'amount' => 10000],
    ],
    'is_active' => true,
    'is_global' => true,
]);

Actions

Filament actions for cart operations:

  • ApplyConditionAction — Apply a condition template to a cart
  • RemoveConditionAction — Remove a condition from a cart

Testing

./vendor/bin/pest tests/src/FilamentCart --parallel

License

MIT License. See LICENSE for details.

aiarmada/filament-cart 适用场景与选型建议

aiarmada/filament-cart 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 112 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 aiarmada/filament-cart 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 aiarmada/filament-cart 我们能提供哪些服务?
定制开发 / 二次开发

基于 aiarmada/filament-cart 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 112
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 19
  • 依赖项目数: 1
  • 推荐数: 2

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-06