How do you type your $model->getKey()
?
#2085
Replies: 3 comments 2 replies
-
This just needs to be fixed in the framework, I'm pretty certain model keys can only be |
Beta Was this translation helpful? Give feedback.
-
It's a good idea to PR it to the framework 👍🏽 But I think we can also make the change here with a stub file and that way we can release faster and more than the latest version would have it. So feel free to open a PR |
Beta Was this translation helpful? Give feedback.
-
I opened a pull request on the framework, but note that it can also be null (on pivots) : as specified in EloquentPivotTest. |
Beta Was this translation helpful? Give feedback.
-
This handy method on models to get the key value is typed as
mixed
by the framework, it's not ideal because when using it on other methods it's easy to get "Unable to resolve the template type ..." errors.I was wondering how do you solve this on your projects ?
Beta Was this translation helpful? Give feedback.
All reactions