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

Can't unset attribute value from entity #94

Closed jlstandout closed 2 years ago

jlstandout commented 5 years ago

Hello.

I have entity with 2 attributes. When I set values it works well, but when I try to set values as 'NULL' it deletes value from database, but in object DUMP it still shows old values. After I clear cache, values from object are gone.

Second problem is if I try to reset entity values AND in request I have attribute values for attribute with "is_collection=true", values are not reset at all. Even after cache clear.

I made test repository with fresh Laravel installation. In README I tried to describe how to setup project and how to replicate issue. If someone has fixed issue, please give me a hint. I hope Author of this wonderful package can also take a look.

More about bug: https://github.com/jlstandout/laravel_attributes_bug

Omranic commented 2 years ago

For first issue, I assume this has been fixed in recent releases.

And for the second issue, I did a complete rewrite for the whole package and changed how collections work. In the new refactor, it actually uses normal relationships, and should be easy and straightforward like default Laravel relationships. Although, that refactor is incomplete.

I'm still not happy with the overall performance (I believe we can reduce number of executed queries), if you want to check it out, see https://github.com/rinvex/laravel-attributes/tree/refactor-to-native-laravel-relationships

Currently no plans to merge that rewrite, but hopefully sometime I can get it to a stable state, improve performance and release it. Any help with that branch would be much appreciated! 🙂