VentureCraft / revisionable

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

Allow overwriting of `getRelatedModel()` method #393

Open lukasleitsch opened 3 years ago

lukasleitsch commented 3 years ago

If the relationship of a model don't follow the default Laravel naming the package can't identify the correct relationship. Therefore, the method identifiableName() is not working:

Issue: #270

The package allow in the config to define an own revision model. My idea is to define a custom revision model and extend the package model. In the custom model I would overwrite the getRelatedModel() to adjust the logic to find the correct relationship.

The PR changes the visibility of the method to allow an overwriting.