-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Description
Eloquent assumes heavily that you are using surrogate keys on your tables (the id
field in every table). However in real world usage, particularly older database systems not designed with web frameworks in mind, there are often tables with composite keys. That is, the primary key is over two or more columns. Often, you can't just add autoincremented id's. This is definitely a game stopper for a lot of use-cases, where you are forced to access existing RDBMS (e.g. building a frontend for an existing db). See also this reddit post about this issue.
The schema builder has already support for composite keys, however eloquent doesn't seem to support it yet.
I request the feature to use composite keys in your eloquent models and queries. The default configuration for surrogate keys is fine, just add the option.