Closed uphlewis closed 2 years ago
This still doesn't solve the eager loading (Attribute::with('values')
) issue, but it does solve the lazy loading issue.
Thank you for your patience, I did a complete rewrite for the whole package and changed how collections & relationshs 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! 🙂
Hi! Great package, thanks.
Stumbled onto the above error when trying to lazy load
$attribute->values
Would there be any drawbacks of changing the method signature of
Rinvex/Attributes/Models/Attribute::values()
slightly?Currently the method looks like this:
So trying to access
$attribute->values
as a dynamic property throws an error becauseAttribute::values()
expects a$value
argument.My proposed fix:
Thoughts ?