Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

HeppyEkberg/Subtype-Laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Subtype (Laravel)

The Subtype trait is to split a database table into different models based on a column and it's value.

To use the trait you have to specify which column and what it's value is with the following attributes:

 use HeppyEkberg\Subtype\Subtype;

 public $subtypeColumn = 'COLUMN_NAME';
 public $subtypeValue = 'COLUMN_VALUE';

Composer:

  "require": {
    "heppyekberg/subtype-laravel": "^1"
  },
  "repositories": [
    { "type": "vcs", "url": "https://github.com/HeppyEkberg/subtype-laravel.git" }
  ],