$ show aimeos/aimeos-laravel
This is a Laravel service provider package that integrates the full-featured Aimeos e-commerce system into Laravel applications. It provides route definitions (admin backend via JQAdm, GraphQL API, JSON REST API, MCP bridge, frontend catalog/checkout/account pages), controllers that delegate to Aimeos HTML/JSONAPI clients, CLI commands for setup, account management, job execution, and cache clearing, and a set of service container bindings (aimeos.shop, aimeos.context, aimeos.config, etc.) that wire Laravel's session, mail, filesystem, and database managers into Aimeos' context. The architecture is that of a thin integration layer: the actual e-commerce logic (products, orders, customers, pricing, basket, checkout, shipping, payments, subscriptions, SEO, multi-vendor, multi-warehouse) lives in the separate aimeos-core and ai-* packages. This package handles Laravel-specific concerns like routing, authentication, configuration merging, and view rendering. It also includes a MCP (Model Context Protocol) bridge that exposes Aimeos admin tools through Laravel's optional MCP SDK, a resolver controller for URL-based content routing (catalog categories, products, CMS pages), and a set of facades for frontend controllers. The code is well-structured, follows PSR-4, uses scoped service bindings, and has comprehensive test coverage.
The LLM identified 3 files worth highlighting for reuse:
Implements a URL resolver that tries multiple handlers (product, catalog, cms) to match an incoming path to the correct page. Uses a static register() method allowing third-party packages to inject new resolver functions. Each resolver returns a Response or throws a 404 exception to fall through to the next handler. This pattern is reusable for any application that needs content-based URL routing (e.g., a CMS or portal) and can be extracted by copying the class and the route definition.
Adapts a framework-neutral Aimeos admin tool (Aimeos\Admin\Mcp\Tool) to the Laravel MCP Tool interface. Translates JSON schema definitions, handles exceptions, and formats responses. Demonstrates a clean separation between domain logic (the tool) and framework-specific MCP integration. Reusable as a template for exposing any domain-specific tool set through the Laravel MCP server.
Provides a base command with an exec() method that iterates over locale sites, clones the context, and runs a closure for each site in parallel using Aimeos' process manager (with PCNTL forking and a check decorator). Handles caching and view creation for each site. This pattern is reusable for any multi-tenant or multi-site batch job (e.g., data exports, index updates, notifications) and can be extracted by copying the exec method and the closure execution pattern.