rinvex / laravel-attributes

⚠️ [ABANDONED] Rinvex Attributable is a robust, intelligent, and integrated Entity-Attribute-Value model (EAV) implementation for Laravel Eloquent, with powerful underlying for managing entity attributes implicitly as relations with ease. It utilizes the power of Laravel Eloquent, with smooth and seamless integration.
MIT License
433 stars 104 forks source link

getEntityAttributes return more than it should #107

Closed divdax closed 2 years ago

divdax commented 4 years ago

Given i've two items of App\Category with Attributable Trait and two attributes where each attribute is assigned to a specific category through attribute_entity table with entity_id.

Now when i'm trying to get the attribute for the first category with

$category->getEntityAttributes();

it will return both attributes, but each category has only one attribute assigned.

Why?

divdax commented 4 years ago

@Omranic ?

Omranic commented 2 years ago

Thank you for your patience, this is limited by design, and it's difficult to implement the other way. For more details, check this: https://github.com/rinvex/laravel-attributes/blob/5aff4aef8eed44c64c55a13ec1cceabda650d7e9/src/Traits/Attributable.php#L189-L215

However, PRs to add this feature are welcome 🙂