{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/5355","labels_url":"https://api.github.com/repos/laravel/framework/issues/5355/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/5355/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/5355/events","html_url":"https://github.com/laravel/framework/issues/5355","id":39602742,"number":5355,"title":"Eloquent should support composite keys","user":{"login":"aebersold","id":1629126,"avatar_url":"https://avatars.githubusercontent.com/u/1629126?v=3","gravatar_id":"","url":"https://api.github.com/users/aebersold","html_url":"https://github.com/aebersold","followers_url":"https://api.github.com/users/aebersold/followers","following_url":"https://api.github.com/users/aebersold/following{/other_user}","gists_url":"https://api.github.com/users/aebersold/gists{/gist_id}","starred_url":"https://api.github.com/users/aebersold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aebersold/subscriptions","organizations_url":"https://api.github.com/users/aebersold/orgs","repos_url":"https://api.github.com/users/aebersold/repos","events_url":"https://api.github.com/users/aebersold/events{/privacy}","received_events_url":"https://api.github.com/users/aebersold/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/laravel/framework/labels/database","name":"database","color":"eb6420"},{"url":"https://api.github.com/repos/laravel/framework/labels/proposal","name":"proposal","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":48,"created_at":"2014-08-06T09:10:27Z","updated_at":"2015-07-15T15:18:12Z","closed_at":"2015-01-30T20:10:50Z","body":"Eloquent assumes heavily that you are using [surrogate keys](http://en.wikipedia.org/wiki/Surrogate_key) 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](http://en.wikipedia.org/wiki/Compound_key). 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](http://www.reddit.com/r/PHP/comments/1yqown/worse_things_about_laravel/cfn9w24) about this issue.\r\n\r\nThe schema builder has already support for [composite keys](http://laravel.com/docs/schema#adding-indexes), however eloquent doesn't seem to support it yet.\r\n\r\nI 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. "},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/121649505","html_url":"https://github.com/laravel/framework/issues/5355#issuecomment-121649505","issue_url":"https://api.github.com/repos/laravel/framework/issues/5355","id":121649505,"user":{"login":"atkaye","id":400663,"avatar_url":"https://avatars.githubusercontent.com/u/400663?v=3","gravatar_id":"","url":"https://api.github.com/users/atkaye","html_url":"https://github.com/atkaye","followers_url":"https://api.github.com/users/atkaye/followers","following_url":"https://api.github.com/users/atkaye/following{/other_user}","gists_url":"https://api.github.com/users/atkaye/gists{/gist_id}","starred_url":"https://api.github.com/users/atkaye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atkaye/subscriptions","organizations_url":"https://api.github.com/users/atkaye/orgs","repos_url":"https://api.github.com/users/atkaye/repos","events_url":"https://api.github.com/users/atkaye/events{/privacy}","received_events_url":"https://api.github.com/users/atkaye/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T15:18:12Z","updated_at":"2015-07-15T15:18:12Z","body":"@ClickerMonkey Agree 100%, still a little way to go (I was crazy busy last week) but I've made good progress so far"}}