Download the PHP package isaacqc/laravel-single-table-inheritance without Composer

On this page you can find all versions of the php package isaacqc/laravel-single-table-inheritance. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-single-table-inheritance

Laravel-Single-Table-Inheritance

Mapping domain model into relational database is hard. For this reason there are many ways to do that. Single table inheritance is one of them. the stengths of this approach are:

Laravel-Single-Table-Inheritance is a package that offer a simple and basic model to handle single table inheritance with eloquent ORM. Be aware this pattern come from Martin Fowler(Patterns of Enterprise Application Architecture). For more information follow this link: Single Table Inheritance. Also check my post about Single table inheritance.

Build Status

Requirements

Installation with Composer

To install Laravel-Single-Table-Inheritance with Composer, add this line to your composer.json file in the `require field:

"jacopo/laravel-single-table-inheritance": "1.0.*"

Congratulations! You succesfully installed the package.

Usage

To use the package you need to extend Jacopo\LaravelSingleTableInheritance\Models\Model on your model class. Then you need to change the following attributes of your model:

The field $table_type contains the string that will be saved in the $table_type_field column to distinguish the current model to the other models saved in the table. The field $my_attributes is an array that contains all the attributes that belongs to the current model(except the eloquent attributes created_at updated_at and deleted_at which are auto setted). For a better understanding on how to setup your model you should definatelly look in the examples folder.

Keep in mind that each model can fetch the data only from the rows that belongs to his type even if all data is stored and the same table! You can only set and get attributes related to the current model and his parents. If you want to fetch all the data inside the table you should create custom queries.


All versions of laravel-single-table-inheritance with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
illuminate/support Version ~5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package isaacqc/laravel-single-table-inheritance contains the following files

Loading the files please wait ....