vault backup: 2026-01-23 14:06:35
This commit is contained in:
11
Career/Resources/Packages/Parental.md
Normal file
11
Career/Resources/Packages/Parental.md
Normal file
@@ -0,0 +1,11 @@
|
||||
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.
|
||||
Reference in New Issue
Block a user