Skip to content

Register Eloquent class alias for phpstan#31

Merged
firecow merged 1 commit intomainfrom
fix/ignore-eloquent-mixin-class-error
Feb 24, 2026
Merged

Register Eloquent class alias for phpstan#31
firecow merged 1 commit intomainfrom
fix/ignore-eloquent-mixin-class-error

Conversation

@firecow
Copy link
Copy Markdown
Member

@firecow firecow commented Feb 24, 2026

Summary

  • Registers the Eloquent class alias via bootstrapFiles so phpstan always knows the class exists
  • The \Eloquent alias is normally registered during Laravel bootstrap, but when that fails intermittently in CI, phpstan reports class.notFound for @mixin \Eloquent in model files
  • bootstrapFiles is the correct phpstan mechanism for making classes discoverable (stubs only override PHPDocs, they don't register new classes)

Test plan

  • Verify phpstan no longer reports class.notFound for @mixin \Eloquent

@firecow firecow self-assigned this Feb 24, 2026
@firecow firecow force-pushed the fix/ignore-eloquent-mixin-class-error branch from 9b79c5a to efc295b Compare February 24, 2026 08:52
@firecow firecow changed the title Ignore unknown Eloquent class in @mixin PHPDoc Add Eloquent stub for phpstan Feb 24, 2026
@firecow firecow merged commit 4a01f27 into main Feb 24, 2026
3 checks passed
@firecow firecow changed the title Add Eloquent stub for phpstan Register Eloquent class alias for phpstan Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant