Skip to content

webbingbrasil/eloquent-sti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Eloquent STI

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
{
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages