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

Adds support for resolving types of model relations accessed as property #361

Merged
merged 1 commit into from
Nov 5, 2019
Merged

Conversation

canvural
Copy link
Collaborator

@canvural canvural commented Nov 5, 2019

This PR adds support for specifying types for model relations accessed as model properties.

$user->posts for example, returns a collection of posts.

There is one thing though. I had to remove Illuminate\Database\Eloquent\Model from the universalObjectCratesClasses for this to work. So this can result in some new errors for the users. Because now all the property accesses will be checked by PHPStan. But as I said, this is also required for this extension to work.

@nunomaduro nunomaduro merged commit 97b9868 into larastan:master Nov 5, 2019
@nunomaduro
Copy link
Collaborator

Awesome job. Thanks!

@nunomaduro
Copy link
Collaborator

@canvural Don't hesitate in adding your github sponsors page into the funding github.

@szepeviktor
Copy link
Collaborator

https://github.com/nunomaduro/larastan/blob/master/.github/FUNDING.yml

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.

3 participants