jurager / eav
Flexible Entity-Attribute-Value (EAV) system for Laravel with typed storage, localization, and attribute inheritance
Fund package maintenance!
1.0.1
2026-11-04 14:51 UTC
Requires
- php: ^8.4
- illuminate/cache: ^13.0
- illuminate/contracts: ^13.0
- illuminate/database: ^13.0
- illuminate/support: ^13.0
- illuminate/validation: ^13.0
- jurager/filterable: ^1.6
Requires (Dev)
- laravel/scout: ^11.0
- meilisearch/meilisearch-php: ^1.0
- orchestra/testbench: ^11.0
- phpunit/phpunit: ^11.0|^12.0
Suggests
- jurager/media: Adds a file/image attribute type backed by a media library.
- jurager/microservice: Serves attribute codes of JSON:API sparse fieldsets (InteractsWithSparseFieldsets).
- laravel/scout: Required to index attribute values for search (HasSearchableAttributes).
- meilisearch/meilisearch-php: Required for faceted search and filterable index settings with the Meilisearch engine.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-04 14:53:07 UTC
README
Add typed, localized attributes to Eloquent models, with support for inheritance and select fields.
$product->eav()->set('color', 'blue')->save(); $product->eav()->value('color'); // 'blue'
Requirements
PHP >= 8.4 and Laravel 13.x
Installation
composer require jurager/eav
See installation and setup. The full documentation is also available online.
Testing
vendor/bin/phpunit
The suite runs on SQLite in memory. To run it on PostgreSQL, which has its own column types and indexes, point it at an empty database:
DB_CONNECTION=pgsql DB_HOST=127.0.0.1 DB_DATABASE=eav_test DB_USERNAME=postgres vendor/bin/phpunit
License
Open source, licensed under the MIT license.