Skip to content

PHP trait to use composite keys in your Laravel Eloquent models.

License

Notifications You must be signed in to change notification settings

mpociot/laravel-composite-key

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Composite Key Trait

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

}

About

PHP trait to use composite keys in your Laravel Eloquent models.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages