plank / laravel-metable

A package for handling arbitrary data in Laravel 5 applications
MIT License
281 stars 42 forks source link

Support soft-deleted models and keep meta #67

Closed emildayan closed 2 years ago

emildayan commented 2 years ago

This PR solves the issue of metas being deleted even if the metable model still exists (but soft-deleted).

The idea of soft-deleting is that it can be restored later on, or kept in the database for future use, logic, statistics etc. Today, Metable just observe for deleted, but won't take SoftDeletion into consideration.

I tried to extend the Meta class, but as the observer is in the bootMetable function it cannot be overriden, thus this must exist natively in the package.

frasmage commented 2 years ago

Closing this as your master branch is full of a bunch of other changes that are not relevant to the main package. If you are still interested in adding this feature, please open a pull request from a branch which only contains the soft delete changes.