Closed jimrubenstein closed 2 years ago
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! 🙂
The README shows that the proper way to add values to a multi-value attribute is using the
ValueCollection@add
method:However, when viewing the contents of the collection
The collection is empty.
Further, the object contained in
my_attribute
is not aValueCollection
, it's a standardIlluminate\Support\Collection
.Could you please share some insight or code examples on how multi-value attributes are intended to be used?
Thanks!