Closed dhildreth closed 5 years ago
Have you tried doing $attribute->delete();
as shown here on line 240?
Thanks for the response, but that will actually delete the attribute entirely. I still want to keep the attribute for the entity, but I want to 'null' it out.
It probably deserves more testing, but this seems to do the trick:
$product->{$key}()->delete();
I'm struggling with building a UI for creating, editing, and deleting attributes. Specifically, I'm stuck on deleting the attributes from the entity (product).
I imagine it should be something as simple as a foreach loop to remove/unset all attributes:
However, that doesn't work and I'm left with this monstrosity of a solution:
I'm hoping this is one of those moments where I'm just missing something simple. I could use a hand please!