Files
2026-01-23 14:06:35 +01:00

12 lines
662 B
Markdown

https://github.com/tighten/parental
A Laravel package that implements Single Table Inheritance (STI) for Eloquent models. Allows extending parent models while referencing the same database table, enabling model-specific behavior without separate tables.
**Key features:**
- Automatic type column management to track model types
- `become()` method for transitioning models between types
- Relationship eager loading helpers for child models (`childrenWith`, `loadChildren`)
- Laravel Nova integration
Useful for scenarios like user roles (Admin, Guest) or order states (Pending, Shipped) where models share database structure but need distinct functionality.