Skip to content

Add mixin annotation for Token model in AccessToken#1886

Merged
taylorotwell merged 3 commits intolaravel:13.xfrom
fjkorf:13.x-add-mixin-annotation-for-Token-model-in-AccessToken
Feb 10, 2026
Merged

Add mixin annotation for Token model in AccessToken#1886
taylorotwell merged 3 commits intolaravel:13.xfrom
fjkorf:13.x-add-mixin-annotation-for-Token-model-in-AccessToken

Conversation

@fjkorf
Copy link
Contributor

@fjkorf fjkorf commented Feb 10, 2026

AccessToken uses the underlying Token instance, but PHPStan can't infer that statically. Without @mixin Token, PHPStan reports errors like "method X not found on AccessToken" or "property Y not found on AccessToken" whenever someone accesses a Token method or property through an AccessToken instance.

The @mixin annotation tells PHPStan that this class also exposes the API surface of Token

@taylorotwell taylorotwell merged commit 729ac2a into laravel:13.x Feb 10, 2026
12 checks passed
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.

2 participants