{"repo":"illuminatech/db-role","free":true,"listed":false,"github":"https://github.com/illuminatech/db-role","clone":"git clone https://github.com/illuminatech/db-role.git","description":"Provides relation roles (table inheritance) for Eloquent","language":"PHP","stars":15,"topics":["laravel","eloquent","role","database"],"license":null,"category":"databases-storage","readme_excerpt":"Eloquent Role Inheritance Extension This extension provides support for Eloquent relation role (table inheritance) composition. For license information check the LICENSE-file. Installation ------------ The preferred way to install this extension is through composer. Either run or add to the require section of your composer.json. Usage ----- This extension provides support for Eloquent relation role composition, which is also known as table inheritance. For example: assume we have a database for the University. There are students studying in the University, and there are instructors teaching the students. Student has a study group and scholarship information, while instructor has a rank and salary. However, both student and instructor have name, address, phone number and so on. Thus we can split their data in the three different tables: - 'humans' - stores common data - 'students' - stores student special data and reference to the 'humans' record - 'instructors' - stores instructor special data and reference to the 'humans' record DDL for such solution may look like following: This extension introduces \\Illuminatech\\DbRole\\InheritRole trait, which allows role relation based Eloquent inheritance. In order to make it work, first of all, you should create an Eloquent class for the base table, in our example it will be 'humans': Then you will be able to compose Eloquent classes, which implements role-based inheritance using \\Illuminatech\\DbRole\\InheritRole . There are 2 different ","default_branch":null,"files":null,"tree":[],"storefront":"/r/illuminatech","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/illuminatech/db-role/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}