tighten / parental

Use single table inheritance in your Laravel app
MIT License
1.36k stars 98 forks source link

Use abstract class as parent. #109

Closed LenRick closed 1 year ago

LenRick commented 1 year ago

Problem: Using an abstract class as a parent did work in the past, but since updating our application to laravel 10 and parental 1.3.3 we have the issue that we can't use an abstract class anymore as parent. (Error: Cannot instantiate abstract class...).

\Parental\HasChildren::registerModelEvent Changing the self to static did do the trick. I made a quick test to show the fix.

driftingly commented 1 year ago

Thanks @LenRick and thanks for the tests 🙌 I made the change on another large codebase using Parental and all tests passed as well.