Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Composite Key

Laravel Composite Key Laravel Package

mpociot/laravel-composite-key

Adds support for composite primary keys in Laravel Eloquent models. This package lets models with multi-column keys work with common Eloquent operations like saving, updating, deleting, and finding records, without hacking around the framework's single-key assumptions.

View on GitHub
Deep Wiki
Context7

mpociot/laravel-composite-key adds first-class support for composite primary keys to Laravel's Eloquent ORM. Instead of forcing a single auto-incrementing ID, models can define an array of key columns and let the package handle lookups, persistence, and key generation behind the scenes.

It is designed as a drop-in trait for existing Eloquent models, keeping composite-key logic isolated while preserving normal model behavior.

  • Define multiple primary key columns via $primaryKey
  • Supports Eloquent find, save, and delete operations
  • Generates and resolves composite key values automatically
  • Works with existing models through a simple trait
  • Keeps key handling out of your application code
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console