mpociot / laravel-composite-key
Support composite keys in your laravel app.
Installs: 43 280
Dependents: 1
Suggesters: 0
Security: 0
Stars: 34
Watchers: 3
Forks: 5
Open Issues: 2
Requires
- php: >=5.5.9
- illuminate/database: 5.*
This package is auto-updated.
Last update: 2024-10-24 10:58:55 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']; }