Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

How to specify composite primary key for models? #469

Closed
karunkshrestha opened this Issue · 1 comment

2 participants

karunkshrestha Jan Hartigan
karunkshrestha

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?

Jan Hartigan janhartigan added the question label
Jan Hartigan
Owner

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.

Jan Hartigan janhartigan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.