PHPackages                             sebwas/laravel-eloquent-compound-keys - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sebwas/laravel-eloquent-compound-keys

AbandonedLibrary

sebwas/laravel-eloquent-compound-keys
=====================================

This helps using eloquent when using compound keys in the database

v1.0.4(9y ago)070MITPHP

Since Mar 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/sebwas/laravel-eloquent-compound-keys)[ Packagist](https://packagist.org/packages/sebwas/laravel-eloquent-compound-keys)[ RSS](/packages/sebwas-laravel-eloquent-compound-keys/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

Laravel Eloquent compound keys support
======================================

[](#laravel-eloquent-compound-keys-support)

Usage
-----

[](#usage)

In your Model that uses the compound keys, simply put `use SebWas\Laravel\Eloquent\CompoundKeys;`. If another Model is referencing this through a *HasManyThrough* relationship, use the `SebWas\Laravel\Eloquent\CompoundKeysRelationship` trait with it.

Limits
------

[](#limits)

There are a few limits to this, that can be solved by overriding the functions and re-implementing them properly.

- The static `destroy` can't be called
- The `morphTo` relationship won't work
- HasManyThrough's `getHasCompareKey` doesn't work
- Some other functions, especially on relations may be buggy

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Total

5

Last Release

3616d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e0276c30d4d99d5a346fc1f840cfe3285115ea244cdc687fc1425c2ffa11943?d=identicon)[sebwas](/maintainers/sebwas)

---

Top Contributors

[![sebwas](https://avatars.githubusercontent.com/u/690725?v=4)](https://github.com/sebwas "sebwas (15 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sebwas-laravel-eloquent-compound-keys/health.svg)

```
[![Health](https://phpackages.com/badges/sebwas-laravel-eloquent-compound-keys/health.svg)](https://phpackages.com/packages/sebwas-laravel-eloquent-compound-keys)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
