How to specify composite primary key for models? #469

karunkshrestha opened this Issue Jan 31, 2014 · 1 comment

2 participants


I have a table which has a composite primary, I am not sure how to specify it in the model and how this will handled by laravel administrator?

Can I specify a different ORM for laravel admin, say doctrine?

@janhartigan janhartigan added the question label Feb 6, 2014
FrozenNode member

Composite primary keys aren't built into Eloquent, and as it stands Administrator relies heavily on methods like getKey() that internally only expects one value to return from that. Administrator is also built entirely (and only) for Eloquent, so it's not possible to swap doctrine in. There are no plans (and likely will be none for a long time) to allow for this as it's already difficult enough to make it work nicely in Eloquent. Maybe after v5 comes out I can revisit this.

@janhartigan janhartigan closed this Feb 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment