aimeos/ai-client-jsonapi
JSON:API client for Aimeos that exposes the shop and admin APIs over HTTP. Integrates with Laravel and other PHP frameworks to fetch and modify catalog, customers, baskets, and orders using standardized JSON:API endpoints.
Install via Composer: composer require aimeos/ai-client-jsonapi. Once installed, the package registers Laravel facade aliases and service providers automatically. Start by configuring the Aimeos JSON API routes in routes/api.php (e.g., Route::prefix('jsonapi')->group(\Aimeos\AiClient\JsonApi\Support\Facades\Routes::class . '::routes');). The first use case is typically fetching product lists: GET /jsonapi/commerce/products?filter[status]=1&include=media,price,catalog. Responses follow the JSON API specification (application/vnd.api+json), making them ready for frontend consumption.
JsonapiController trait in your custom Laravel controllers to add Aimeos JSON API endpoints alongside other routes.If-None-Match support—responses include ETag headers; clients can use conditional requests to reduce bandwidth.Product, Basket) via Laravel’s service provider to add custom fields or relationships (e.g., include=attributes,customOptions).middleware('auth:sanctum') on routes requiring authenticated users (e.g., /jsonapi/commerce/basket for cart updates).Aimeos\AiClient\JsonApi\JsonapiRequest) in config/aimeos.php under 'client/jsonapi' => ['request' => \App\JsonApi\CustomRequest::class] to adjust parameter parsing.json() helpers) re-encodes the Aimeos response.commerce/ prefixes (e.g., /jsonapi/commerce/products). Avoid overlapping custom API paths unless explicitly namespaced.?page[size]=50 or globally in config/aimeos.php: 'client/jsonapi' => ['page' => ['size' => 25]].'debug' => true in config/aimeos.php—but never in production. Check storage/logs/aimeos.log for server-side JSON API errors.reviews to products, bind a custom JsonApi\Adapter\Product in the service provider’s register() method: app()->singleton(\Aimeos\AiClient\JsonApi\Adapter\Product::class, \App\JsonApi\Adapter\CustomProduct::class);.How can I help you explore Laravel packages today?