rinvex / laravel-categories

Rinvex Categorizable is a polymorphic Laravel package, for category management. You can categorize any eloquent model with ease, and utilize the power of Nested Sets, and the awesomeness of Sluggable, and Translatable models out of the box.
MIT License
461 stars 68 forks source link

Possibly a bug #28

Closed ghost closed 6 years ago

ghost commented 6 years ago

Here follows the behavior:

  1. I have a Product model that is using the Categorizable trait.
  2. This Product model also uses the SoftDeletes trait.
  3. A product is registered with some categories attached.
  4. When i run the "destroy" method from the model to soft deletes it, all categories are detached.

I was just expecting to disable the registry and keep your categories.

Omranic commented 6 years ago

Well, this isn’t tested scenario, but it could be valid since we still didn’t implement or test SoftDelete behavior, but it’s planned since the beginning. For now, please try to change current behavior I’m your own model, until this is ready. Sorry for the inconvenience..

ghost commented 6 years ago

No problem, let me know if you need any help with this.

Cheers.

Omranic commented 6 years ago

Any PRs are always welcome of course 🙏😁

ghost commented 6 years ago

Haha ok, i made a PR. I'm waiting for this to be merged into master branch. Thank you.

darkons commented 2 years ago

Could this fix be applied to the 6.0.0 version for Laravel 8.x users?

Omranic commented 2 years ago

@darkons thank you for your message. Currently we're not supporting older versions of Laravel, however you can fork it and apply the same fix if you want.