VentureCraft / revisionable

Easily create a revision history for any laravel model
http://twitter.com/duellsy
MIT License
2.55k stars 348 forks source link

Disable system wide on specific projects #388

Closed subdesign closed 3 years ago

subdesign commented 3 years ago

I have a composer package which handles users. I use this in an admin project, where I have to manage user revisions. But I use this package in a frontend project, where I need the above mentioned User model, so I have to install revisionable, but this time I don't need revisions, how to set (if possible) system wide protected $revisionEnabled = false; dynamically, maybe at boot time?

Of course I can't update this attribute to false in the model file, because it's in a common package between admin & frontend.

afraca commented 3 years ago

(I was browsing randomly here) Probably too late but we have a Laravel app that's the specific website (frontend), and it uses our in-house admin package. The admin package has a user model, but the app always uses its own User model extending from admin package. You can then change the property in your app User model.