New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

mpociot/laravel-composite-key

Support composite keys in your laravel app.
46,113 35

Larablocks Analysis

mpociot/laravel-composite-key works with Laravel 5 (latest release 1.0, May 17, 2016), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5, past end of life
  • No release in the last 12 months (last: May 17, 2016)
  • 328 downloads a month (needs 10,000)
  • 35 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: May 17, 2016.
  • No releases in the last 12 months.
  • First released: May 17, 2016.
  • Monthly downloads: 328, up 958% from six months ago.
  • 2 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.

Install
composer require mpociot/laravel-composite-key
Latest Version:1.0
PHP:>=5.5.9
Laravel:5
License:MIT
Last Updated:Nov 18, 2020
Links: GitHub  ·  Packagist
Maintainer: mpociot

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...

670,032,257 9,703
laravel/framework

The Laravel Framework.

640,572,096 35,338
laravel/tinker

Powerful REPL for the Laravel framework.

546,909,908 7,440
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

465,816,364 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

438,010,529 4,660

Version History

Version Released PHP Laravel License
1.0 >=5.5.9 5.* MIT