Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always infer return type of id property on models #499

Merged
merged 1 commit into from Mar 20, 2020
Merged

Always infer return type of id property on models #499

merged 1 commit into from Mar 20, 2020

Conversation

canvural
Copy link
Collaborator

There are some cases when there is migration but not a model file. For example pivot tables. So Larastan will complain about the property accesses.

This PR, adds logic to always assume a property named id exists on the model. I think this is a safe assumption to make. And it can solve couple of errors.

@szepeviktor
Copy link
Collaborator

Related #491

@canvural canvural merged commit 1055d4a into larastan:master Mar 20, 2020
@canvural canvural deleted the patch-2 branch March 20, 2020 05:35
@tectiv3
Copy link

tectiv3 commented Mar 23, 2020

Assuming that id exists on a model is reasonable, but that it is always integer - probably not.
UUID as a primary key is pretty common, I think.

@zlodes
Copy link

zlodes commented Apr 16, 2020

How to disable this?
We are using UUID and string type in @property was ignored...

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

Successfully merging this pull request may close these issues.

None yet

5 participants