mpociot/laravel-composite-key
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'];
}
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
648,266,899
9,701
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
429,221,767
607
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
403,217,078
4,664
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.0 | >=5.5.9 | 5.* | MIT |