2017 © Pedro Peláez
 

library laravel-possible-composite-key

PHP trait to use composite keys in your Laravel Eloquent models and does not fail on possible missing column.

image

rvzug/laravel-possible-composite-key

PHP trait to use composite keys in your Laravel Eloquent models and does not fail on possible missing column.

  • Tuesday, September 19, 2017
  • by rvzug
  • Repository
  • 1 Watchers
  • 1 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 38 % Grown

The README.md

laravel-possible-composite-key

PHP trait to use composite keys in your Laravel Eloquent models and does not fail on possible missing column., (*1)

Installation:

composer require rvzug/laravel-possible-composite-key

Usage:

<?php

use Rvzug\CanHasCompositeKey;
use Illuminate\Database\Eloquent\Model;

class MyModel extend Model {
    use CanHasCompositeKey;

    protected $primaryKey = ['one', 'two', 'three'];
    public $incrementing = false;

}

In your migrations / database it's now possible to add Nullable to 'one', 'two', 'three'. Assuming that at least one of the other is filled with a near-unique value. For example an ArticleCode or Gtin value. In my usages I use keys: 'ArticleCode', 'EanCode', 'Supplier', where code and ean could be empty. The combination of Supplier and one of the codes is reasonably unique., (*2)

The Versions

19/09 2017

dev-master

9999999-dev

PHP trait to use composite keys in your Laravel Eloquent models and does not fail on possible missing column.

  Sources   Download

MIT

The Requires

 

19/09 2017

1.0.1

1.0.1.0

PHP trait to use composite keys in your Laravel Eloquent models and does not fail on possible missing column.

  Sources   Download

MIT

The Requires

 

19/09 2017

1.0

1.0.0.0

PHP trait to use composite keys in your Laravel Eloquent models and does not fail on possible missing column.

  Sources   Download

MIT

The Requires