Repository navigation
[12.x] Makes imports consistent - #59149
Merged
Merged
Conversation
18 tasks done
nunomaduro
marked this pull request as ready for review
March 10, 2026 19:52
jonagoldman
pushed a commit
to deplox/laravel-framework
that referenced
this pull request
Apr 30, 2026
4 of 6 tasks
binaryfire
added a commit
to hypervel/components
that referenced
this pull request
Sep 24, 2026
laravel/framework#59149 imports classes that the mail, form request and rule stubs only mention in PHPDoc. The import collides with a generated class of the same name, so make:mail Attachment, make:request ValidationRule and make:rule PotentiallyTranslatedString generate files PHP refuses to load. The event stub had the same problem with Channel. Laravel has these bugs. The mail, request and rule stubs keep their fully qualified PHPDoc types, and the event stub now qualifies Channel as well. The generator tests share a lint assertion. New tests generate each colliding name for the plain, markdown and view mail stubs, the request stub, both rule stubs and the event stub, and check that the result compiles. The factory test uses the same assertion. The request, rule and event generator tests also get their missing property and return types. Claude-Session: https://claude.ai/code/session_01WveaB7yyFo2T6yo7cnEpW9
binaryfire
added a commit
to hypervel/components-backup
that referenced
this pull request
Oct 1, 2026
Following laravel/framework#59149, the mail, markdown mail, view mail, form request and validation rule stubs import the classes their PHPDoc references (Attachment, ValidationRule and PotentiallyTranslatedString). The event, job middleware and middleware stubs already did. The factory stub differs from Laravel's: it keeps the model's fully-qualified name in the PHPDoc instead of importing the model. Importing it makes the generated file fatal when the model is named Factory, or shares the generated factory's name. Laravel master has this bug. A comment in FactoryMakeCommand records why, and a regression test generates PlantFactory for a Factory model and lints the result. Validation: the generator suite passes. Claude-Session: https://claude.ai/code/session_01WveaB7yyFo2T6yo7cnEpW9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
More info: laravel/pint#425