Support composite keys in your laravel app.

1.0 2016-05-17 20:11 UTC

This package is auto-updated.

Last update: 2022-09-24 06:32:49 UTC


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'];