misaf / vendra-attribute-api
API services for the vendra-attribute module
Package info
github.com/misaf/vendra-attribute-api
Type:vendra-module
pkg:composer/misaf/vendra-attribute-api
Requires
- php: ^8.3
- illuminate/support: ^13.0
- misaf/vendra-api: ^0.0.5
- misaf/vendra-attribute: ^0.0.5
- spatie/laravel-package-tools: ^1.93.1
Requires (Dev)
- fakerphp/faker: ^1.24.1
- larastan/larastan: ^3.10.0
- laravel-json-api/testing: ^3.2
- laravel/boost: ^2.4.12
- laravel/pint: ^1.29.3
- misaf/vendra-testing: ^0.0.5
- mockery/mockery: ^1.6.12
- nunomaduro/collision: ^8.9.4
- orchestra/testbench: ^11.1
- pestphp/pest: ^4.7.5
- pestphp/pest-plugin-arch: ^4.0.2
- pestphp/pest-plugin-laravel: ^4.1
- pestphp/pest-plugin-profanity: ^4.2.1
- pestphp/pest-plugin-type-coverage: ^4.0.4
- phpstan/extension-installer: ^1.4.3
README
JSON:API services for the misaf/vendra-attribute domain module. Exposes attribute values through a Laravel JSON:API interface.
Features
- Read-only JSON:API resource for
AttributeValuemodels - Polymorphic attribute values exposed through a consistent API
- Tenant-agnostic — works with or without a tenant provider
- Conditionally integrated into
misaf/vendra-product-apiwhen both packages are installed (attribute values appear on product endpoints automatically)
Requirements
- PHP 8.3+
- Laravel 13
misaf/vendra-attributemisaf/vendra-api
Installation
composer require misaf/vendra-attribute-api
The service provider is auto-registered. The JSON:API server registers at /v1.
Resources
attribute-values — read-only
| Field | Type | Notes |
|---|---|---|
id |
ID | |
attribute_id |
Number | |
value |
Str | |
position |
Number | Read-only |
created_at |
Carbon | Read-only |
updated_at |
Carbon | Read-only |
Filters: id, exclude (by ID).
Cross-module Integration
When misaf/vendra-product-api detects this package, it conditionally registers attributeValues as a relationship on the products resource and serves AttributeValueSchema under the vendra-product server. No configuration required.
API Routes
GET /v1/attribute-values— list attribute valuesGET /v1/attribute-values/{id}— show a single attribute value
Tenant Awareness
Tenancy is inherited from misaf/vendra-attribute domain models, which derive tenant behavior from misaf/vendra-support. The API module stays tenant-agnostic and never references a concrete tenant provider.
Testing and Analysis
composer test
composer analyse
License
MIT.