Closed dhildreth closed 3 years ago
Eager loading seems to have issues at this point due to new Eloquent changes, so please avoid using it for now until we come up with a solution.
For the attribute slug, update to the latest version, all slugs are forced to be snake_case
and that would probably fix your issue.
Thank you for taking a look into it!
Any updates on this one? I'd love to be able to seed attributes for staging and testing.
Thank you for your patience, I did a complete rewrite for the whole package and changed how collections & relationships 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! 🙂
Seeing some really strange activity when attempting to seed attributes. I've been able to get it to work, but only when the stars are in alignment and I do the hokey pokey exactly five times while whistling yankie doodle dandy. For the time when running
php artisan db:seed
was successful, I ran it again immediately without making any other changes and it failed the second time. I can't get it to work anymore. Strange part is, I can get the attributes to save just fine when usingphp artisan tinker
. I'm not sure what's happening other than a potential race condition and/or caching issue.So, here we start by clearing the cache and then running
php artisan db:seed
(it does the same thing forphp artisan migrate:fresh --seed
):Okay, so we see we have an error when attempting to seed the DB. Let's see if it works in
php artisan tinker
:Yup, it works here. Not sure what's happening with the seeding part. Any ideas?
DatabaseSeeder.php
AttributeSeeder.php
ProductAttributeSeeder.php
App\Product.php