mpociot/laravel-composite-key

Support composite keys in your laravel app.

1.0 2016-05-17 20:11 UTC

This package is auto-updated.

Last update: 2021-04-24 03:31:30 UTC


README

This is a small trait that I use in my projects, if I need support for composite keys in my Eloquent models.

Install via composer:

composer require mpociot/laravel-composite-key

Then use the trait in your model:

class MyModel extends Model
{
    use HasCompositeKey;

    protected $primaryKey = ['foo', 'bar'];

}