webbingbrasil / eloquent-sti
Brings a Single Table Inheritance capabilities to Eloquent.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 1 028
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.6.4|^7.0
- illuminate/database: >=5.3
- illuminate/support: >=5.3
This package is auto-updated.
Last update: 2022-01-26 20:04:17 UTC
README
Eloquent STI brings a Single Table Inheritance capabilities to Eloquent.
Installation
composer require "webbingbrasil/eloquent-sti=1.0.0"
Usage
Use the CanBeInherited
trait in any entity to get STI capabilities in childs
use WebbingBrasil\EloquentSTI\CanBeInherited; class User extends Model { use CanBeInherited; }
Now just extend the parent model with any child models
class Admin extends User { } class Manager extends User { }