Skip to content
This repository was archived by the owner on Jul 16, 2021. It is now read-only.

Throw an error if a model's $primaryKey is an array #712

Closed
andrechalom opened this issue Aug 3, 2017 · 1 comment
Closed

Throw an error if a model's $primaryKey is an array #712

andrechalom opened this issue Aug 3, 2017 · 1 comment

Comments

@andrechalom
Copy link

There are lots of closed issues regarding the use of composite primary keys, and all of them have been closed by the dev team (eg. laravel/framework#5517). However, the documentation does not clearly mention that composite keys are not supported, and even has an example for generating a migration with a composite primary key.

I understand the reason why this feature will not be implemented, but can you provide a check to provide the application developers with a clear error when they try to implement a composite primary? As it stands, when I tried to use a composite key in one of my models everything started to fail with an "illegal offset type" error, which is not helpful at all.

(Migrated from laravel/framework#20393)

@taylorotwell
Copy link
Member

No plans on changing this for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants