-
Notifications
You must be signed in to change notification settings - Fork 3
[216] convert entity and relation names to PascalCase #218
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
Conversation
src/Commands/MakeEntityCommand.php
Outdated
| $this->extractEntityNameAndPath(); | ||
| $this->validateOnlyApiOption(); | ||
| $this->validateCrudOptions(); | ||
| $this->entityName = $this->convertToPascalCase($this->entityName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move it to handle method, because Is not validation operation.
…ntityCommand refs: #216
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements automatic conversion of entity and relation names from snake_case/lowercase to PascalCase with informative user feedback. When users provide lowercase entity or relation names, the system now converts them to the proper PascalCase format and displays conversion messages.
Key Changes
- Entity names are now converted to PascalCase in the command handler with user notification
- Relation names are automatically converted to PascalCase during parsing
- Removed premature PascalCase conversion in
EntityGenerator::setModel()to allow proper conversion tracking
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Commands/MakeEntityCommand.php | Added convertToPascalCase() method for standardized case conversion with user notification; renamed trimRelations() to prepareRelations() and integrated conversion logic |
| src/Generators/EntityGenerator.php | Removed Str::studly() conversion from setModel() to defer conversion to the command level |
| tests/ModelGeneratorTest.php | Updated test to verify conversion messages are displayed for entity and relation names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
refs: #216