rtconner / laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a "like" or "favorite" or "remember" feature.
MIT License
401 stars 49 forks source link

Cascades #13

Open RustyDev opened 8 years ago

RustyDev commented 8 years ago

I've noticed a few things about cascading when deleting various models.

If a user likes a post and either the user or the post is deleted, the likes aren't deleted as well and the counts don't update.

JesusLeon commented 8 years ago

It would be definitely nice if this is in the package out-of-the-box. But I think it relies more on the application logic.

@RustyDev you could easily add an observer to update the likes data in that scenario. But of course it would be even better if you could send a PR with such functionality :)

rtconner commented 8 years ago

I haven't had to add a config file to this library yet, but if I add this feature I'll want to put in a config file for it. To make the cascade optional.